/** * @param textField * @return The created InputPanel. * @see InputPanel#InputPanel(String, Component) */ public InputPanel add(final TextField<?> textField) { final InputPanel input = new InputPanel(newChildId(), textField); add(input); return input; }
public InputPanel(final String id, final FormComponent< ? > field) { super(id); add(this.field = field); }
/** * @see org.projectforge.web.wicket.flowlayout.AbstractFieldsetPanel#modifyAddedChild(org.apache.wicket.Component) */ @Override protected void modifyAddedChild(final Component child) { if (child instanceof InputPanel) { final InputPanel inputPanel = (InputPanel) child; if (inputPanel.getField() instanceof TextField) { inputPanel.getField().add(AttributeModifier.append("class", "text")); } } }
@Override public void populateItem(Item<ICellPopulator<FFPAccountingDO>> item, String componentId, IModel<FFPAccountingDO> rowModel) { MinMaxNumberField<BigDecimal> field = new MinMaxNumberField<BigDecimal>(InputPanel.WICKET_ID, new PropertyModel<>(rowModel.getObject(), "value"), new BigDecimal(0), new BigDecimal(Integer.MAX_VALUE)); field.setRequired(true); InputPanel input = new InputPanel(componentId, field); input.setEnabled(rowModel.getObject().getEvent().getFinished() == false); item.add(input); }
protected InputPanel setFieldType(final InputPanel input, final FieldType fieldType) { input.setFieldType(fieldType); return input; }
@Override protected InputPanel setFieldType(final InputPanel input, final FieldType fieldType) { if (fieldType == FieldType.E_MAIL) { input.setTypeAttribute("email"); } else if (fieldType == FieldType.WEB_PAGE) { input.setTypeAttribute("url"); } else if (fieldType == FieldType.PHONE_NO) { input.setTypeAttribute("tel"); } return input; }
@Override public void populateItem(Item<ICellPopulator<FFPAccountingDO>> item, String componentId, IModel<FFPAccountingDO> rowModel) { MinMaxNumberField field = new MinMaxNumberField<BigDecimal>(InputPanel.WICKET_ID, new PropertyModel<>(rowModel.getObject(), "weighting"), new BigDecimal(0), new BigDecimal(Integer.MAX_VALUE)); field.setRequired(true); InputPanel input = new InputPanel(componentId, field); input.setEnabled(rowModel.getObject().getEvent().getFinished() == false); item.add(input); }
/** * @see org.projectforge.web.common.timeattr.AttrWicketComponentFactory#createComponents(org.projectforge.web.wicket.flowlayout.AbstractFieldsetPanel, * org.projectforge.framework.persistence.attr.api.AttrDescription, * org.projectforge.framework.persistence.attr.api.EntityWithAttributes) */ @Override public ComponentWrapperPanel createComponents(final String id, final AttrGroup group, final AttrDescription desc, final EntityWithAttributes entity) { final MinMaxNumberField<BigDecimal> textField = new MinMaxNumberField<>( InputPanel.WICKET_ID, new AttrModel<>(entity, desc.getPropertyName(), BigDecimal.class), new BigDecimal(desc.getMinIntValue()), new BigDecimal(desc.getMaxIntValue()) ); setAndOutputMarkupId(textField, group, desc); textField.setRequired(desc.isRequired()); return new InputPanel(id, textField); }
@Override public void populateItem(Item<ICellPopulator<FFPAccountingDO>> item, String componentId, IModel<FFPAccountingDO> rowModel) { InputPanel input = new InputPanel(componentId, new MaxLengthTextField(InputPanel.WICKET_ID, new PropertyModel<>(rowModel.getObject(), "comment"))); input.setEnabled(rowModel.getObject().getEvent().getFinished() == false); item.add(input); }
WicketUtils.setFocus(inputPanel.getField()); focusSet = true;
/** * @see org.projectforge.web.common.timeattr.AttrWicketComponentFactory#createComponents(org.projectforge.web.wicket.flowlayout.AbstractFieldsetPanel, * org.projectforge.framework.persistence.attr.api.AttrDescription, * org.projectforge.framework.persistence.attr.api.EntityWithAttributes) */ @Override public ComponentWrapperPanel createComponents(final String id, final AttrGroup group, final AttrDescription desc, final EntityWithAttributes entity) { final MaxLengthTextField textField = new MaxLengthTextField( InputPanel.WICKET_ID, new AttrModel<>(entity, desc.getPropertyName(), String.class), desc.getMaxLength() ); setAndOutputMarkupId(textField, group, desc); textField.setRequired(desc.isRequired()); return new InputPanel(id, textField); }
fs.add(createAutocompleteTextField("title")).getField().setRequired(true).add(WicketUtils.setFocus());
/** * @see org.projectforge.web.common.timeattr.AttrWicketComponentFactory#createComponents(org.projectforge.web.wicket.flowlayout.AbstractFieldsetPanel, * org.projectforge.framework.persistence.attr.api.AttrDescription, * org.projectforge.framework.persistence.attr.api.EntityWithAttributes) */ @Override public ComponentWrapperPanel createComponents(final String id, final AttrGroup group, final AttrDescription desc, final EntityWithAttributes entity) { final MinMaxNumberField<Integer> textField = new MinMaxNumberField<>( InputPanel.WICKET_ID, new AttrModel<>(entity, desc.getPropertyName(), Integer.class), desc.getMinIntValue(), desc.getMaxIntValue() ); setAndOutputMarkupId(textField, group, desc); textField.setRequired(desc.isRequired()); return new InputPanel(id, textField); }
"searchString")); searchField.add(WicketUtils.setFocus()); fs.add(new InputPanel(fs.newChildId(), searchField));
maxLength); textField.setRequired(param.isRequired()); fs.add(new InputPanel(fs.newChildId(), textField));
"searchString")); searchField.add(WicketUtils.setFocus()); fs.add(new InputPanel(fs.newChildId(), searchField)); fs.add(new IconPanel(fs.newIconChildId(), IconType.HELP, getString("tooltip.lucene.link")).setOnClickLocation( getRequestCycle(),
fieldset.add(new InputPanel(fieldset.newChildId(), new AuftragsPositionFormComponent(InputPanel.WICKET_ID, new PropertyModel<AuftragsPositionDO>(position, "auftragsPosition"), false))); fieldset.add(new IconPanel(fieldset.newIconChildId(), IconType.GOTO, getString("show"))
fs.add(new InputPanel(fs.newChildId(), name));