public FieldProperties<String> getPhoneNumberProperties(final String property, final String labelKey, final String labelDescriptionKey, final FieldType fieldType) { return new FieldProperties<String>(labelKey, new PropertyModel<String>(address, property)) .setLabelDescription(labelDescriptionKey) .setFieldType(fieldType); }
/** * @param textField * @return The created InputPanel. * @see InputPanel#InputPanel(String, Component) */ public InputPanel add(final TextField<?> textField, final FieldProperties<?> fieldProperties) { final InputPanel input = add(textField); if (fieldProperties.getFieldType() != null) { setFieldType(input, fieldProperties.getFieldType()); } return input; }
/** * Adds this FieldsetPanel to the parent panel. * * @param parent * @param label */ public FieldsetPanel(final DivPanel parent, final FieldProperties<?> fieldProperties) { this(parent, getString(parent, fieldProperties.getLabel()), // getString(parent, fieldProperties.getLabelDescription(), fieldProperties.isTranslateLabelDecsription())); }
public FieldProperties<String> getAddressTextProperties(final String addressType, final String addressTextProperty) { return new FieldProperties<String>("address.addressText", new PropertyModel<String>(address, addressTextProperty)) .setLabelDescription( addressType, false); }
public AbstractFieldsetPanel<?> addPublicKey() { final FieldProperties<String> props = getPublicKeyProperties(); final AbstractFieldsetPanel<?> fs = gridBuilder.newFieldset(props); fs.add(new MaxLengthTextArea(TextAreaPanel.WICKET_ID, props.getModel()));// .setAutogrow(); return fs; }
public FieldProperties<ContactStatus> getContactStatusProperties() { return new FieldProperties<ContactStatus>("address.contactStatus", new PropertyModel<ContactStatus>(address, "contactStatus")); }
public FieldProperties<String> getWebsiteProperties() { return new FieldProperties<String>("address.website", new PropertyModel<String>(address, "website")) .setFieldType(FieldType.WEB_PAGE); }
final FieldProperties<String> cityProp = pageSupport.getCityProperties(addressParameters.cityProperty); final FieldProperties<String> zipCodeProp = pageSupport.getCityProperties(addressParameters.zipCodeProperty); cityProp.setValueAsString(StringUtils.defaultString(zipCodeProp.getModel().getObject()) + " " + StringUtils.defaultString(cityProp.getModel().getObject())); final FieldProperties<String> countryProp = pageSupport.getCountryProperties(addressParameters.countryProperty); final FieldProperties<String> phoneProp = phone != null FieldType.PHONE_NO) : null; final String phoneValue = phoneProp != null ? phoneProp.getValue() : null; final FieldProperties<String> mobilePhoneProp = mobile != null ? pageSupport.getPhoneNumberProperties(mobile, "address.phoneType.mobile", null, FieldType.MOBILE_PHONE_NO) : null; final String mobileValue = mobilePhoneProp != null ? mobilePhoneProp.getValue() : null; final FieldProperties<String> faxProp = fax != null ? pageSupport.getPhoneNumberProperties(fax, "address.phoneType.fax", null, null) : null; final String faxValue = faxProp != null ? faxProp.getValue() : null; final String emailValue = emailProp != null ? emailProp.getValue() : null; if (StringHelper.isBlank(addressTextProp.getValue(), cityProp.getValueAsString(), countryProp.getValue(), phoneValue, mobileValue, faxValue, emailValue) == true) {
public void addRow(final FieldProperties< ? > fieldProperties) final Object valueObject = fieldProperties.getValue(); if (valueObject == null) { String valueString = fieldProperties.getValueAsString(); if (valueString == null) { if (valueObject instanceof I18nEnum) { fieldProperties.setValueAsString(valueString); row.add(new Label("label", getString(fieldProperties.getLabel()))); final FieldType type = fieldProperties.getFieldType(); if (type == FieldType.WEB_PAGE) { row.add(new ActionLinkPanel("value", ActionLinkType.EXTERNAL_URL, valueString));
public AbstractFieldsetPanel<?> addPosition() { final FieldProperties<String> props = getPositionTextProperties(); final AbstractFieldsetPanel<?> fs = gridBuilder.newFieldset(props); fs.add(new MaxLengthTextField(fs.getTextFieldId(), props.getPropertyModel())); return fs; }
public static void createBirthdayPanel(final GridBuilder gridBuilder, EmployeeDO data) { // Birthday final FieldProperties<Date> props = new FieldProperties<>("fibu.employee.birthday", new PropertyModel<>(data, "birthday")); final AbstractFieldsetPanel<?> fs = gridBuilder.newFieldset(props); DatePanel datePanel = new DatePanel( fs.newChildId(), props.getModel(), DatePanelSettings.get().withTargetType(java.sql.Date.class)); datePanel.getDateField().setMarkupId("birthday").setOutputMarkupId(true); fs.add(datePanel); fs.add(new HtmlCommentPanel(fs.newChildId(), new Model<String>() { @Override public String getObject() { return WicketUtils.getUTCDate("birthday", data.getBirthday()); } })); }
/** * @param labelDescription the labelDescription to set * @return this for chaining. */ public FieldProperties<T> setLabelDescription(final String labelDescription) { return setLabelDescription(labelDescription, true); }
public AddressMobileViewPage(final PageParameters parameters) { super(parameters); pageSupport = new AddressPageSupport(gridBuilder, data); gridBuilder.newCollapsiblePanel(data.getFullNameWithTitleAndForm()); final LabelValueDataTablePanel table = gridBuilder.newLabelValueDataTable(); table.addRow(pageSupport.getOrganizationProperties()); table.addRow(pageSupport.getPositionTextProperties()); table.addRow(pageSupport.getAddressStatusProperties()); table.addRow(pageSupport.getWebsiteProperties()); addAddress(pageSupport.getBusinessAddressParameters(), "businessPhone", "mobilePhone", "fax", pageSupport.getEmailProperties()); addAddress(pageSupport.getPrivateAddressParameters(), "privatePhone", "privateMobilePhone", null, pageSupport.getPrivateEmailProperties()); addAddress(pageSupport.getPostalAddressParameters(), null, null, null, null); final FieldProperties<String> comment = pageSupport.getCommentProperties(); if (StringUtils.isNotBlank(comment.getValue()) == true) { final CollapsiblePanel panel = gridBuilder.newCollapsiblePanel(getString(comment.getLabel())).setCollapsed(); panel.add(new DivTextPanel(panel.newChildId(), comment.getValue())); } }
@SuppressWarnings("serial") public MobileFieldsetPanel(final String id, final FieldProperties< ? > fieldProperties) { super(id); fieldset = new WebMarkupContainer("fieldset"); superAdd(fieldset); this.labelText = fieldProperties.getLabel(); fieldset.add((label = new WebMarkupContainer("label"))); label.add(new Label("labeltext", new Model<String>() { @Override public String getObject() { return getString(labelText); }; }).setRenderBodyOnly(true)); fieldsRepeater = new RepeatingView("fields"); fieldset.add(fieldsRepeater); }
public AbstractFieldsetPanel<?> addComment() { final FieldProperties<String> props = getCommentProperties(); final AbstractFieldsetPanel<?> fs = gridBuilder.newFieldset(props); final MaxLengthTextArea comment = new MaxLengthTextArea(TextAreaPanel.WICKET_ID, props.getModel()); fs.add(comment, true); return fs; }
public FieldProperties<AddressStatus> getAddressStatusProperties() { return new FieldProperties<AddressStatus>("address.addressStatus", new PropertyModel<AddressStatus>(address, "addressStatus")); }
public FieldProperties<String> getAddressTextProperties(final String addressType, final String addressTextProperty) { return new FieldProperties<String>("address.addressText", new PropertyModel<String>(contact, addressTextProperty)) .setLabelDescription( addressType, false); }
public FieldProperties<String> getWebsiteProperties() { return new FieldProperties<String>("address.website", new PropertyModel<String>(contact, "website")) .setFieldType(FieldType.WEB_PAGE); }
@SuppressWarnings("serial") public AbstractFieldsetPanel<?> addOrganization() { final FieldProperties<String> props = getOrganizationProperties(); final AbstractFieldsetPanel<?> fs = gridBuilder.newFieldset(props); fs.add( dependentFormComponents[2] = new PFAutoCompleteMaxLengthTextField(fs.getTextFieldId(), props.getPropertyModel()) { @Override protected List<String> getChoices(final String input) { return contactDao.getAutocompletion("organization", input); } }.withMatchContains(true).withMinChars(2)); return fs; }
public FieldProperties<String> getEmailProperties() { return new FieldProperties<String>("email", new PropertyModel<String>(contact, "email")) .setLabelDescription("contact.business") .setFieldType(FieldType.E_MAIL); }