Refine search
public BooleanFilterPanel(String id, final IModel<Boolean> valueModel) { super(id, valueModel); List<Boolean> list = Lists.newArrayList(); list.add(Boolean.TRUE); list.add(Boolean.FALSE); final DropDownChoice<Boolean> choice = new DropDownChoice<>("booleanChoice", valueModel, list); choice.add(new AjaxFormSubmitBehavior("change") {}); choice.setNullValid(true); add(choice); this.choiceComponent = choice; }
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 boolean hasOwnPeriodOfPerformance(final DropDownChoice<PeriodOfPerformanceType> performanceChoice) { return PeriodOfPerformanceType.OWN == performanceChoice.getModelObject(); } }
/** * Called when a selection changes. */ public final void onSelectionChanged() { convertInput(); updateModel(); onSelectionChanged(getModelObject()); }
/** * @see org.projectforge.web.wicket.flowlayout.ComponentWrapperPanel#getComponentOutputId() */ @Override public String getComponentOutputId() { dropDownChoice.setOutputMarkupId(true); return dropDownChoice.getMarkupId(); }
/** * Factory method for create a new {@link DropDownChoice}. * * @param <T> * the generic type of the {@link DropDownChoice} * @param id * the id * @param model * the model * @param choices * The collection of choices in the dropdown * @return the new {@link DropDownChoice}. */ public static <T> DropDownChoice<T> newDropDownChoice(final String id, final IModel<T> model, final List<? extends T> choices) { final DropDownChoice<T> dropDownChoice = new DropDownChoice<>(id, model, choices); dropDownChoice.setOutputMarkupId(true); return dropDownChoice; }
public NewStatementGroupFragment(String aId) { super(aId, "newStatementGroup", StatementGroupPanel.this, groupModel); IModel<KBHandle> property = Model.of(); Form<KBHandle> form = new Form<>("form", property); DropDownChoice<KBHandle> type = new BootstrapSelect<>("property"); type.setModel(property); type.setChoiceRenderer(new ChoiceRenderer<>("uiLabel")); type.setChoices(getUnusedProperties()); type.setRequired(true); type.setOutputMarkupId(true); form.add(type); focusComponent = type; form.add(new LambdaAjaxButton<>("create", this::actionNewProperty)); form.add(new LambdaAjaxLink("cancel", this::actionCancelNewProperty)); add(form); }
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")); } }
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 } };
@Override protected void populateItem(Item<RolePermission> item) { item.add(new Label("registrant", item.getModelObject().getRegistrant().getObject().getName())); final DropDownChoice<PermissionSetting> permissionChoice = new DropDownChoice<PermissionSetting>("permission", Arrays.asList(PermissionSetting .values()), new PermissionSettingRenderer()); permissionChoice.setOutputMarkupId(true); permissionChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") { private static final long serialVersionUID = 1L; protected void onUpdate(AjaxRequestTarget target) { target.add(permissionChoice); } }); item.add(permissionChoice); }
private DropDownChoice<AddressType> newModbusAddressTypeDropdown( final ModbusConfigurationEntry configEntry) { final DropDownChoice<AddressType> dropDown = new DropDownChoice<AddressType>( "type", new PropertyModel<AddressType>(configEntry, "modbusRange.modbusAddressType"), modbusTypes, new ModbusAddressTypeChoiceRenderer()); dropDown.setRequired(true); dropDown.add(new OnChangeAjaxBehavior() { @Override protected void onUpdate(AjaxRequestTarget target) { configEntry.getModbusRange().setModbusAddressType(dropDown.getModelObject()); } }); return dropDown; }
private void addUsersDropDownChoice() { IModel<List<Actor>> actorsModel = $m.get(() -> moduleService.findEligibleUsers(dataModel.getObject(), itemAction.getConfirmation())); usersDropDownChoice = new DropDownChoice<>("usersDropDownChoice", new Model<>(), actorsModel, new ChoiceRenderer<>("nome", "codUsuario")); usersDropDownChoice.add(new AjaxFormComponentUpdatingBehavior("change") { @Override protected void onUpdate(AjaxRequestTarget target) { target.add(confirmButton); } }); border.add(usersDropDownChoice); }
public PortalDetails(String id, IModel choices) { super(id); final DropDownChoice ddo = new DropDownChoice("portlet", choices, new IChoiceRenderer() { private static final long serialVersionUID = 1L; public Object getDisplayValue(Object object) { return object; } public String getIdValue(Object object, int index) { return (String) object; } }); ddo.setNullValid(false); ddo.setOutputMarkupId(true); add(ddo); }
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); }
public UimaStringTraitsEditor(String aId, IModel<AnnotationFeature> aFeature) { super(aId); DropDownChoice<TagSet> tagset = new BootstrapSelect<>("tagset"); tagset.setOutputMarkupPlaceholderTag(true); tagset.setOutputMarkupId(true); tagset.setChoiceRenderer(new ChoiceRenderer<>("name")); tagset.setNullValid(true); tagset.setModel(PropertyModel.of(aFeature, "tagset")); tagset.setChoices(LoadableDetachableModel.of(() -> annotationService .listTagSets(aFeature.getObject().getProject()))); add(tagset); } }
private DropDownChoice<AnnotationLayer> createDefaultAnnotationLayerSelector() { DropDownChoice<AnnotationLayer> selector = new BootstrapSelect<>("defaultAnnotationLayer"); selector.setChoices(new PropertyModel<>(this, "annotationLayers")); selector.setChoiceRenderer(new ChoiceRenderer<>("uiName")); selector.setOutputMarkupId(true); selector.add(LambdaAjaxFormComponentUpdatingBehavior.onUpdate("change", this::actionChangeDefaultLayer)); return selector; }
private void initPageSizeChoice(final IPageableItems pageable, final PagerConfigurator configurator) { final DropDownChoice<Long> choice = new DropDownChoice<>("pageSize", CHOICES); choice.setDefaultModel(new PropertyModel<Long>(pageable, "itemsPerPage")); add(choice); choice.add(new AjaxFormComponentUpdatingBehavior("onchange") { @Override protected void onUpdate(AjaxRequestTarget target) { reset(); onAjaxEvent(target); configurator.onItemsPerPageChanged(target, pageable.getItemsPerPage()); } }); } }
login(); tester.startPage(new FormTestPage(new ComponentBuilder() { private static final long serialVersionUID = -6705646666953650890L; tester.assertComponent("form:panel", NetCDFOutTabPanel.class); tester.assertComponent("form:panel:netcdfeditor", NetCDFOutSettingsEditor.class); DropDownChoice<DataPacking> dataPacking = (DropDownChoice<DataPacking>) tester .getComponentFromLastRenderedPage("form:panel:netcdfeditor:container:dataPacking"); assertEquals(dataPacking.getModelObject(), container.getDataPacking());
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 DocumentRepositorySelectionForm(String aId) { super(aId); DropDownChoice<DocumentRepository> repositoryCombo = new BootstrapSelect<DocumentRepository>("repositoryCombo", new PropertyModel<DocumentRepository>(ExternalSearchAnnotationSidebar.this, "currentRepository"), repositoriesModel); repositoryCombo.setChoiceRenderer(new ChoiceRenderer<DocumentRepository>("name")); repositoryCombo.setNullValid(false); // Just update the selection repositoryCombo.add(new LambdaAjaxFormComponentUpdatingBehavior("change")); add(repositoryCombo); } }