DropDownChoice<Client> dropDownChoice = new DropDownChoice("clientSelection", listClients) { @Override protected boolean wantOnSelectionChangedNotifications() { return true; } @Override protected void onSelectionChanged(Object newSelection) { // Do something here when selection is changed } };
DropDownChoice ddc = new DropDownChoice(id, model, choices){ @Override protected String getNullKey(){ return "customDdcNullValue"; } @Override protected String getNullValidKey(){ return "customDdcNullValue"; } }
/** * * @param id * @param label see {@link FormComponent#setLabel(IModel)} * @param model * @param values * @param renderer */ public DropDownChoicePanel(final String id, final IModel<T> model, final List< ? extends T> values, final IChoiceRenderer<T> renderer) { this(id, new DropDownChoice<T>(WICKET_ID, model, values, renderer), false); }
public DropDownChoiceWrapperPanel( String id, IModel<T> model, List<? extends T> list, ChoiceRenderer<T> renderer) { super(id, model); add(new DropDownChoice<T>("innerComponent", model, list, renderer).setRequired(true)); } }
public AddRestrictedComponentDialog(ComponentDAO dao, RenderPlugin plugin, JcrNodeModel parent, List<String> choices) { super(dao, plugin, parent); if (choices == null || choices.isEmpty()) { throw new IllegalArgumentException("List of choices cannot be null or empty"); } getBean().setName(choices.get(0)); DropDownChoice dc = new DropDownChoice("name", choices); add(dc); setFocusOnCancel(); }
public AddRestrictedComponentDialog(ComponentDAO dao, RenderPlugin plugin, JcrNodeModel parent, List<String> choices) { super(dao, plugin, parent); if (choices == null || choices.size() == 0) { throw new IllegalArgumentException("List of choices cannot be null or empty"); } getBean().setName(choices.get(0)); DropDownChoice dc = new DropDownChoice("name", choices); add(dc); setFocusOnCancel(); }
public AddRestrictedContainerComponentDialog(ContainerComponentDAO dao, RenderPlugin plugin, JcrNodeModel parent, List<String> choices) { super(dao, plugin, parent); if (choices == null || choices.isEmpty()) { throw new IllegalArgumentException("List of choices cannot be null or empty"); } getBean().setName(choices.get(0)); DropDownChoice dc = new DropDownChoice("name", choices); add(dc); setFocusOnCancel(); }
private DropDownChoice<String> createSessionsSelector(String id) { IModel<String> defaultSession = getCurrentSession(); DropDownChoice<String> sessionsSelector = new DropDownChoice<String>("sessions", defaultSession, new SessionsProviderModel()); return sessionsSelector; }
@Override protected void createRoleSourceDropDown() { add( roleSourceChoice = new DropDownChoice<RoleSource>( "roleSource", Arrays.asList(J2EERoleSource.values()), new RoleSourceChoiceRenderer())); } }
protected void createRoleSourceDropDown() { add( roleSourceChoice = new DropDownChoice<RoleSource>( "roleSource", Arrays.asList(PreAuthenticatedUserNameRoleSource.values()), new RoleSourceChoiceRenderer())); }
public EditableRequiredDropDownCellPanel(final String id, final PropertyColumn<T, S> column, @SuppressWarnings("rawtypes") final List choices) { super(id); @SuppressWarnings("unchecked") DropDownChoice<T> field = new DropDownChoice<T>("dropdown", choices); field.setLabel(column.getDisplayModel()); add(field); }
private DropDownChoice criarDropDown(IModel<List<Actor>> actorsModel, Model<Actor> model) { DropDownChoice<Actor> dropDownChoice = new DropDownChoice<>("selecao", model, actorsModel, new ChoiceRenderer<>("nome", "codUsuario")); dropDownChoice.setRequired(true); return dropDownChoice; }
public TypePanel(String id, AbstractColumn column, IModel rowModel, IModel itemModel) { super(id, column, rowModel); List<Type> types = Arrays.asList(Type.values()); DropDownChoice<Type> choice; add(choice = new DropDownChoice<Type>("dropDown", itemModel, types, typeRenderer)); choice.setNullValid(false); choice.setRequired(true); }
private DropDownChoice<String> createSessionsSelector(String id) { IModel<String> defaultSession = getCurrentSession(); DropDownChoice<String> sessionsSelector = new DropDownChoice<String>("sessions", defaultSession, new SessionsProviderModel()); return sessionsSelector; }
private DropDownChoice<String> createChoice(String id, int mode) { DropDownChoice<String> choice = new DropDownChoice<>(id, new Model<>(), Arrays.asList(AM, PM)); boolean support = isSupportAmPm(); choice.setOutputMarkupId(true); choice.setNullValid(false); if (mode != -1) choice.setModelObject(mode == Calendar.AM ? choice.getChoices().get(0) : choice.getChoices().get(1)); else choice.setModelObject(choice.getChoices().get(0)); choice.setVisible(support); choice.setEnabled(support); return choice; }
private FormComponent<Short> createPositionColumn(final PaymentScheduleDO payment) { final List<Short> availablePositionNumbers = payment.getAuftrag().getPositionenExcludingDeleted().stream() .map(AuftragsPositionDO::getNumber) .collect(Collectors.toList()); return new DropDownChoice<>("positionNumber", new PropertyModel<>(payment, "positionNumber"), availablePositionNumbers) .setNullValid(true) .setRequired(true) .setLabel(new ResourceModel("fibu.auftrag.position")); } }
public EventWorkflowForm(String id, IModel<List<Workflow>> model, WebMarkupContainer wTable) { super(id, model); add(new DropDownChoice<String>("event_list", new PropertyModel(this, "selectedEvent"), wm.safeGetRegisteredEvents())); this.wTable = wTable; }
public EventWorkflowForm(String id, IModel<List<Workflow>> model, WebMarkupContainer wTable) { super(id, model); add(new DropDownChoice<String>("event_list", new PropertyModel(this, "selectedEvent"), wm.safeGetRegisteredEvents())); this.wTable = wTable; }
protected void build(IModel info, Form form) { // overview policy form.add(new DropDownChoice("overviewPolicy", Arrays.asList(OverviewPolicy.values()), new OverviewPolicyRenderer())); form.add(new CheckBox("subsamplingEnabled")); // resource limits TextField maxInputMemory = new TextField("maxInputMemory"); maxInputMemory.add(new MinimumValidator(0l)); form.add(maxInputMemory); TextField maxOutputMemory = new TextField("maxOutputMemory"); maxOutputMemory.add(new MinimumValidator(0l)); form.add(maxOutputMemory); }
TypeDetailStep(NewDocumentTypeAction action, final List<String> candidatesSuperTypes) { super(new ResourceModel("type-detail-title"), new ResourceModel("type-detail-summary")); final DropDownChoice<String> superTypeChoice = new DropDownChoice<>("super-type-list", new PropertyModel<>(action, "superType"), candidatesSuperTypes); add(superTypeChoice); IModel<String> nameLabel = new ResourceModel("name-caption"); nameComponent = new RequiredTextFieldWidget("name", PropertyModel.of(action, "name"), nameLabel); nameComponent.getFormComponent().add(NamespaceValidator.createNameValidator()); add(nameComponent); setFocus(nameComponent.getFormComponent()); }