Example usage for org.apache.wicket.markup.html.form Form setOutputMarkupId

List of usage examples for org.apache.wicket.markup.html.form Form setOutputMarkupId

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.form Form setOutputMarkupId.

Prototype

public final Component setOutputMarkupId(final boolean output) 

Source Link

Document

Sets whether or not component will output id attribute into the markup.

Usage

From source file:org.dcm4chee.wizard.edit.xds.XDSSourceEditPage.java

License:LGPL

private void addOptionalFormAttributes(ExtendedForm form) {
    final Form<?> optionalContainer = new Form<Object>("optional");
    optionalContainer.setOutputMarkupId(true);
    optionalContainer.setOutputMarkupPlaceholderTag(true);
    optionalContainer.setVisible(false);
    form.add(optionalContainer);/*w  w  w.j a  v  a  2  s.  c o  m*/
    addToggleOptionalCheckBox(form, optionalContainer);

    FormUtils.addGenericField(optionalContainer, "xdsRegistry", xdsRegistry, false, false);
    FormUtils.addGenericField(optionalContainer, "xdsRepository", xdsRepository, false, false);

    optionalContainer
            .add(new Label("xdsSourceUrl.label", new ResourceModel("dicom.edit.xds.xdsSourceUrl.label"))
                    .setOutputMarkupPlaceholderTag(true));
    optionalContainer.add(new TextField<String>("xdsSourceUrl", xdsSourceUrlModel).setType(String.class));

}

From source file:org.devgateway.eudevfin.dim.desktop.components.GroupingBoxPanel.java

License:Open Source License

protected void populate(String searchString) {
    this.resultsPanel.setVisible(false);
    this.searchWrapperPanel.add(this.resultsPanel);
    this.add(this.searchWrapperPanel);

    superUser = AuthUtils.currentUserHasRole(AuthConstants.Roles.ROLE_SUPERVISOR);

    final GroupingBoxPanelForm boxPanelForm = new GroupingBoxPanelForm();
    CompoundPropertyModel<GroupingBoxPanelForm> boxPanelFormModel = new CompoundPropertyModel<GroupingBoxPanelForm>(
            boxPanelForm);//from   w  w w  .j a v  a2  s .  com
    Form<?> form = new Form<>("searchForm", boxPanelFormModel);
    form.setOutputMarkupId(false);

    final DropDownField<String> crsIdSearch = new DropDownField<>("crsIdSearch",
            new RWComponentPropertyModel<String>("crsIdSearch"),
            new PredefinedStringProvider(txService.findDistinctCRSId()), "desktop.search.crsid");

    crsIdSearch.setSize(InputBehavior.Size.Medium);
    crsIdSearch.removeSpanFromControlGroup();
    form.add(crsIdSearch);

    final DropDownField<String> donorIdSearch = new DropDownField<>("donorIdSearch",
            new RWComponentPropertyModel<String>("donorIdSearch"),
            new PredefinedStringProvider(txService.findDistinctDonorProjectNumber()), "desktop.search.donorid");
    donorIdSearch.setSize(InputBehavior.Size.Medium);
    donorIdSearch.removeSpanFromControlGroup();
    form.add(donorIdSearch);

    final CheckBoxField active = new CheckBoxField("active", new RWComponentPropertyModel<Boolean>("active"),
            "desktop.search.active");
    active.removeSpanFromControlGroup();
    form.add(active);

    BootstrapSubmitButton submitButton = new BootstrapSubmitButton("submit",
            new StringResourceModel("desktop.searchbutton", this, null)) {

        private static final long serialVersionUID = -1342816632002116152L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            // Access the updated model object:
            if ((boxPanelForm.getCrsIdSearch() != null && boxPanelForm.getCrsIdSearch().length() > 1)
                    || (boxPanelForm.getDonorIdSearch() != null
                            && boxPanelForm.getDonorIdSearch().length() > 1)) {
                GroupingBoxPanel.this.listGenerator.setSearchBoxPanelForm(boxPanelForm);
                GroupingBoxPanel.this.resultsPanel.generateListOfItems(1);
                GroupingBoxPanel.this.resultsPanel.setVisible(true);
            } else
                GroupingBoxPanel.this.resultsPanel.setVisible(false);
            target.add(GroupingBoxPanel.this.searchWrapperPanel);
        }

    };
    form.add(submitButton);

    BootstrapCancelButton resetButton = new BootstrapCancelButton("reset",
            new StringResourceModel("desktop.resetbutton", this, null)) {

        private static final long serialVersionUID = -7554180087300408868L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            crsIdSearch.getField().setDefaultModelObject(null);
            donorIdSearch.getField().setDefaultModelObject(null);
            active.getField().setDefaultModelObject(null);
            target.add(crsIdSearch.getField());
            target.add(donorIdSearch.getField());
            target.add(active.getField());
            GroupingBoxPanel.this.resultsPanel.setVisible(false);
            target.add(GroupingBoxPanel.this.searchWrapperPanel);
        }

    };
    form.add(resetButton);

    this.add(form);
}

From source file:org.devgateway.eudevfin.dim.desktop.components.SearchBoxPanel.java

License:Open Source License

protected void populate(String searchString) {
    this.resultsPanel.setVisible(false);
    this.searchWrapperPanel.add(this.resultsPanel);
    this.add(this.searchWrapperPanel);

    superUser = AuthUtils.currentUserHasRole(AuthConstants.Roles.ROLE_SUPERVISOR);

    final SearchBoxPanelForm boxPanelForm = new SearchBoxPanelForm();
    CompoundPropertyModel<SearchBoxPanelForm> boxPanelFormModel = new CompoundPropertyModel<SearchBoxPanelForm>(
            boxPanelForm);/* w  w w  . j  a  v a  2 s  .  c  o m*/
    Form<?> form = new Form<>("searchForm", boxPanelFormModel);
    form.setOutputMarkupId(false);

    final DropDownField<Integer> year = new DropDownField<Integer>("year",
            new YearToLocalDateTimeModel(new RWComponentPropertyModel<LocalDateTime>("year")),
            new YearProvider(this.txService.findAllDistinctReportingYears()));
    year.setSize(InputBehavior.Size.Medium);
    year.removeSpanFromControlGroup();
    year.hideLabel();
    form.add(year);

    final DropDownField<Category> sectorPurposeCode = new DropDownField<>("sector",
            new RWComponentPropertyModel<Category>("sector"),
            categoryFactory.get(CategoryConstants.ALL_SECTOR_TAG));
    //sectorPurposeCode.setSize(InputBehavior.Size.Medium);
    sectorPurposeCode.hideLabel();
    sectorPurposeCode.removeSpanFromControlGroup();
    form.add(sectorPurposeCode);

    final TextInputField<String> searchInputField = new TextInputField<String>("searchString",
            new RWComponentPropertyModel<String>("searchString"), "desktop.search");
    searchInputField.typeString();
    searchInputField.setSize(InputBehavior.Size.Medium);
    searchInputField.hideLabel();
    searchInputField.removeSpanFromControlGroup();
    form.add(searchInputField);

    extendingAgency = new DropDownField<>("extendingAgency",
            new RWComponentPropertyModel<Organization>("extendingAgency"), organizationProvider);
    //extendingAgency.setSize(InputBehavior.Size.Medium);
    extendingAgency.hideLabel();
    extendingAgency.removeSpanFromControlGroup();

    form.add(extendingAgency);

    final DropDownField<String> formType = new DropDownField<>("formType",
            new RWComponentPropertyModel<String>("formType"), new FormTypeProvider(this));
    formType.setSize(InputBehavior.Size.Medium);
    formType.hideLabel();
    formType.removeSpanFromControlGroup();
    form.add(formType);

    final DropDownField<Area> recipient = new DropDownField<>("recipient",
            new RWComponentPropertyModel<Area>("recipient"), areaProvider);
    recipient.setSize(InputBehavior.Size.Medium);
    recipient.hideLabel();
    recipient.removeSpanFromControlGroup();
    form.add(recipient);

    BootstrapSubmitButton submitButton = new BootstrapSubmitButton("submit",
            new StringResourceModel("desktop.searchbutton", this, null)) {

        private static final long serialVersionUID = -1342816632002116152L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            // Access the updated model object:
            if ((boxPanelForm.getSearchString() != null && boxPanelForm.getSearchString().length() > 1)
                    || boxPanelForm.getSector() != null || boxPanelForm.getYear() != null
                    || boxPanelForm.getRecipient() != null || boxPanelForm.getFormType() != null
                    || boxPanelForm.getExtendingAgency() != null) {
                SearchBoxPanel.this.listGenerator.setSearchBoxPanelForm(boxPanelForm);
                SearchBoxPanel.this.resultsPanel.generateListOfItems(1);
                SearchBoxPanel.this.resultsPanel.setVisible(true);
            } else
                SearchBoxPanel.this.resultsPanel.setVisible(false);
            target.add(SearchBoxPanel.this.searchWrapperPanel);
        }

    };
    form.add(submitButton);

    BootstrapCancelButton resetButton = new BootstrapCancelButton("reset",
            new StringResourceModel("desktop.resetbutton", this, null)) {

        private static final long serialVersionUID = -7554180087300408868L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            sectorPurposeCode.getField().setDefaultModelObject(null);
            searchInputField.getField().setDefaultModelObject(null);
            extendingAgency.getField()
                    .setDefaultModelObject(superUser ? null : AuthUtils.getOrganizationForCurrentUser());
            year.getField().setDefaultModelObject(null);
            formType.getField().setDefaultModelObject(null);
            recipient.getField().setDefaultModelObject(null);
            target.add(sectorPurposeCode.getField());
            target.add(searchInputField.getField());
            target.add(year.getField());
            target.add(extendingAgency.getField());
            target.add(formType.getField());
            target.add(recipient.getField());
            SearchBoxPanel.this.resultsPanel.setVisible(false);
            target.add(SearchBoxPanel.this.searchWrapperPanel);
        }

    };
    form.add(resetButton);

    this.add(form);
}

From source file:org.devgateway.eudevfin.dim.pages.Messages.java

License:Open Source License

public Messages() {
    super();//w  ww .  j a  v  a 2s  . co  m

    ListGeneratorInterface<Message> listGenerator = new ListGeneratorInterface<Message>() {
        @Override
        public PagingHelper<Message> getResultsList(int pageNumber, int pageSize) {
            return PagingHelper.createPagingHelperFromPage(
                    mxService.findByTo(AuthUtils.getCurrentUser(), new PageRequest(pageNumber - 1, pageSize)));
        }
    };

    final MessagesListTable list = new MessagesListTable("list", listGenerator);
    add(list);

    final Model<Message> messageModel = new Model<>(new Message());

    form = new Form<>("form", messageModel);
    form.setOutputMarkupId(true);
    add(form);

    //DropDownField<PersistedUser> to = new DropDownField<>("to", new PropertyModel<PersistedUser>(messageModel, "to"), userChoiceProvider);
    MultiSelectField<PersistedUser> to = new MultiSelectField<>("to",
            new PropertyModel<Collection<PersistedUser>>(messageModel, "to"), userChoiceProvider);
    to.required();
    to.setSize(InputBehavior.Size.XXLarge);
    form.add(to);

    TextInputField<String> subject = new TextInputField<>("subject",
            new PropertyModel<String>(messageModel, "subject"));
    subject.typeString();
    subject.setSize(InputBehavior.Size.XXLarge);
    form.add(subject);

    messageInputField = new TextAreaInputField("message", new PropertyModel<String>(messageModel, "message"));
    messageInputField.setOutputMarkupId(true);
    messageInputField.setSize(InputBehavior.Size.XXLarge);
    messageInputField.maxContentLength(Message.MAX_BODY_SIZE);
    form.add(messageInputField);

    MultiFileUploadField attachments = new MultiFileUploadField("attachments",
            new PropertyModel<Collection<FileWrapper>>(messageModel, "attachments"));
    form.add(attachments);

    BootstrapSubmitButton send = new BootstrapSubmitButton("send",
            new StringResourceModel("send.label", this, null, null)) {
        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            final Message message = messageModel.getObject();
            message.setFrom(AuthUtils.getCurrentUser());
            message.setSendDate(LocalDateTime.now());
            mxService.save(message);

            messageModel.setObject(new Message());
            target.add(form);

            list.reloadMessageList(target);
        }
    };
    form.add(send);
}

From source file:org.devgateway.eudevfin.projects.module.components.panels.SearchBoxPanel.java

License:Open Source License

protected void populate(String searchString) {
    this.resultsPanel.setVisible(false);
    this.searchWrapperPanel.add(this.resultsPanel);
    this.add(this.searchWrapperPanel);

    superUser = AuthUtils.currentUserHasRole(AuthConstants.Roles.ROLE_SUPERVISOR);

    final SearchProjectForm boxPanelForm = new SearchProjectForm();
    CompoundPropertyModel<SearchProjectForm> boxPanelFormModel = new CompoundPropertyModel<SearchProjectForm>(
            boxPanelForm);/*www  .  ja  v a  2 s  .  c  o  m*/
    Form<?> form = new Form<>("searchForm", boxPanelFormModel);
    form.setOutputMarkupId(false);

    final TextInputField<String> projectName = addProjectName(form);
    final DropDownField<String> projectType = addProjectType(form);
    final DropDownField<Integer> startDate = addYear(form, "startDate");
    final DropDownField<Integer> stopDate = addYear(form, "stopDate");
    final TextInputField<String> implOrganization = addImplOrganization(form);
    final DropDownField<Area> geographicFocus = addGeoFocus(form);

    extendingAgency = new DropDownField<>("financingInstitution",
            new RWComponentPropertyModel<Organization>("financingInstitution"), organizationProvider);
    //extendingAgency.setSize(InputBehavior.Size.Medium);
    extendingAgency.hideLabel();
    extendingAgency.removeSpanFromControlGroup();
    form.add(extendingAgency);

    BootstrapSubmitButton submitButton = new BootstrapSubmitButton("submit",
            new StringResourceModel("desktop.searchbutton", this, null)) {
        private static final long serialVersionUID = -1342816632002116152L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            boolean isVisible;
            if ((boxPanelForm.getProjectName() != null && boxPanelForm.getProjectName().length() > 0)
                    || (boxPanelForm.getImplementingOrganization() != null
                            && boxPanelForm.getImplementingOrganization().length() > 0)
                    || boxPanelForm.getStartDate() != null || boxPanelForm.getStopDate() != null
                    || boxPanelForm.getProjectType() != null || boxPanelForm.getFinancingInstitution() != null
                    || boxPanelForm.getGeographicFocus() != null) {

                SearchBoxPanel.this.listGenerator.setSearchBoxPanelForm(boxPanelForm);
                SearchBoxPanel.this.resultsPanel.generateListOfItems(1);
                SearchBoxPanel.this.resultsPanel.setVisible(true);

                isVisible = false;
            } else {
                SearchBoxPanel.this.resultsPanel.setVisible(false);
                isVisible = true;
            }

            if (allTabPanels != null) {
                SearchBoxPanel.this.allTabPanels.setVisible(isVisible);
                target.add(SearchBoxPanel.this.allTabPanels);
            } else if (projectsPanel != null) {
                SearchBoxPanel.this.projectsPanel.setVisible(isVisible);
                target.add(SearchBoxPanel.this.projectsPanel);
            }

            target.add(SearchBoxPanel.this.searchWrapperPanel);
        }

    };
    form.add(submitButton);

    BootstrapCancelButton resetButton = new BootstrapCancelButton("reset",
            new StringResourceModel("desktop.resetbutton", this, null)) {
        private static final long serialVersionUID = -7554180087300408868L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            startDate.getField().setDefaultModelObject(null);
            stopDate.getField().setDefaultModelObject(null);
            extendingAgency.getField()
                    .setDefaultModelObject(superUser ? null : AuthUtils.getOrganizationForCurrentUser());
            projectName.getField().setDefaultModelObject(null);
            implOrganization.getField().setDefaultModelObject(null);
            projectType.getField().setDefaultModelObject(null);
            geographicFocus.getField().setDefaultModelObject(null);
            target.add(startDate.getField());
            target.add(stopDate.getField());
            target.add(projectName.getField());
            target.add(extendingAgency.getField());
            target.add(implOrganization.getField());
            target.add(projectType.getField());
            target.add(geographicFocus.getField());

            if (allTabPanels != null) {
                SearchBoxPanel.this.allTabPanels.setVisible(true);
                target.add(SearchBoxPanel.this.allTabPanels);
            } else if (projectsPanel != null) {
                SearchBoxPanel.this.projectsPanel.setVisible(true);
                target.add(SearchBoxPanel.this.projectsPanel);
            }

            SearchBoxPanel.this.resultsPanel.setVisible(false);
            target.add(SearchBoxPanel.this.searchWrapperPanel);
        }

    };
    form.add(resetButton);

    this.add(form);
}

From source file:org.devproof.portal.core.module.common.panel.ConfirmDeletePanel.java

License:Apache License

private Form<T> createConfirmDeletePanelForm() {
    Form<T> form = new Form<T>("form", new CompoundPropertyModel<T>(entityModel));
    form.add(createYesAjaxButton());//w  w w  . ja  v a  2  s .  com
    form.add(createNoAjaxButton());
    form.setOutputMarkupId(true);
    return form;
}

From source file:org.devproof.portal.core.module.mount.panel.MountInputPanel.java

License:Apache License

private Form<MountPoint> createForm() {
    Form<MountPoint> form = newForm();
    form.add(createDefaultUrlGroup());//from  www  . j  a v a  2 s.  c  o  m
    form.setOutputMarkupId(true);
    return form;
}

From source file:org.devproof.portal.core.module.right.panel.RightSearchBoxPanel.java

License:Apache License

private Form<RightQuery> createRightSearchForm() {
    Form<RightQuery> form = new Form<RightQuery>("searchForm",
            new CompoundPropertyModel<RightQuery>(queryModel));
    form.add(createSearchTextField());//from  w w  w  .  ja v  a2s  .com
    form.setOutputMarkupId(true);
    return form;
}

From source file:org.devproof.portal.core.module.role.panel.RoleSearchBoxPanel.java

License:Apache License

private Form<RoleQuery> createRoleSearchForm() {
    Form<RoleQuery> form = new Form<RoleQuery>("searchForm", new CompoundPropertyModel<RoleQuery>(queryModel));
    form.add(createSearchTextField());/*from ww w.  ja  v a2s  .  co m*/
    form.add(createActiveDropDown());
    form.setOutputMarkupId(true);
    return form;
}

From source file:org.devproof.portal.core.module.user.page.LoginPage.java

License:Apache License

private Form<ValueMap> createLoginForm() {
    Form<ValueMap> form = newLoginForm();
    form.add(createUsernameField());//  ww  w .  j av a2  s .  co  m
    form.add(createPasswordField());
    form.add(createRegisterLink());
    form.add(createForgotPasswordLink());
    form.setOutputMarkupId(true);
    return form;
}