Package org.apache.wicket.markup.html.form

Examples of org.apache.wicket.markup.html.form.DropDownChoice


            super(id, new CompoundPropertyModel(gmlModel));
           
            //srsNameStyle
            List<GMLInfo.SrsNameStyle> choices =
                Arrays.asList(SrsNameStyle.values());
            DropDownChoice srsNameStyle = new DropDownChoice("srsNameStyle", choices);
            add(srsNameStyle);
        }
View Full Code Here


        String requiredMark = required ? " *" : "";
        Label label = new Label("paramName", paramLabelModel.getObject() + requiredMark);
        add(label);

        // the drop down field, with a decorator for validations
        choice = new DropDownChoice("paramValue", workspaceModel,
                new WorkspacesModel(), new WorkspaceChoiceRenderer());
        choice.setRequired(required);
        // set the label to be the paramLabelModel otherwise a validation error would look like
        // "Parameter 'paramValue' is required"
        choice.setLabel(paramLabelModel);
View Full Code Here

     * </p>
     */
    private void makeNamespaceSyncUpWithWorkspace() {

        // do not allow the namespace choice to be manually changed
        final DropDownChoice wsDropDown = (DropDownChoice) workspacePanel.getFormComponent();
        // add an ajax onchange behaviour that keeps ws and ns in synch
        wsDropDown.add(new OnChangeAjaxBehavior() {
            private static final long serialVersionUID = 1L;

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                // see if the namespace param is tied to a NamespacePanel and save it
                if (namespacePanel == null) {
                    Component paramsPanel = AbstractDataAccessPage.this
                            .get("dataStoreForm:parametersPanel");
                    namespacePanel = findNamespacePanel((MarkupContainer) paramsPanel);

                    if (namespacePanel == null) {
                        // nothing to do
                        return;
                    }
                }

                WorkspaceInfo ws = (WorkspaceInfo) wsDropDown.getModelObject();
                String prefix = ws.getName();
                NamespaceInfo namespaceInfo = getCatalog().getNamespaceByPrefix(prefix);
                namespacePanel.setModelObject(namespaceInfo);
                target.addComponent(namespacePanel.getFormComponent());
            }
View Full Code Here

       
        selectLayers.add(layers);
    }
   
    private DropDownChoice storesDropDown() {
        final DropDownChoice stores = new DropDownChoice("storesDropDown", new Model(),
                new StoreListModel(), new StoreListChoiceRenderer());
        stores.setOutputMarkupId(true);
        stores.add(new AjaxFormComponentUpdatingBehavior("onchange") {
           
            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                if (stores.getModelObject() != null) {
                    StoreInfo store = (StoreInfo) stores.getModelObject();
                    provider.setStoreId(store.getId());
                    storeName.setModelObject(store.getName());
                    selectLayers.setVisible(true);

                    // make sure we can actually list the contents, it may happen
View Full Code Here

                Session.get().error(new ParamResourceModel("sldNotFound", this, style.getFilename()).getString());
            }
        }

        // style copy functionality
        styles = new DropDownChoice("existingStyles", new Model(), new StylesModel(), new StyleChoiceRenderer());
        styles.setOutputMarkupId(true);
        styles.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
View Full Code Here

        setModel(new CompoundPropertyModel(new DataAccessRule(rule)));

        // build the form
        form = new Form("ruleForm");
        add(form);
        form.add(workspace = new DropDownChoice("workspace", getWorkspaceNames()));
        workspace.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                layer.setChoices(new Model(getLayerNames((String) workspace.getConvertedInput())));
                layer.modelChanged();
                target.addComponent(layer);
            }
        });
        setOutputMarkupId(true);
        form.add(layer = new DropDownChoice("layer", getLayerNames(rule.getWorkspace())));
        layer.setOutputMarkupId(true);
        form.add(accessMode = new DropDownChoice("accessMode", MODES, new AccessModeRenderer()));
        form.add(rolesForComponent = new RolesFormComponent("roles", new RolesModel(rule), form,
                true));

        // build the submit/cancel
        form.add(new BookmarkablePageLink("cancel", DataAccessRulePage.class));
View Full Code Here

                // odd/even style
                item.add(new SimpleAttributeModifier("class",
                        item.getIndex() % 2 == 0 ? "even" : "odd"));

                // link info
                DropDownChoice dropDownChoice = new DropDownChoice("type",
                        new PropertyModel(item.getModel(), "metadataType"), LINK_TYPES);
                dropDownChoice.setRequired(true);
                item.add(dropDownChoice);
                FormComponentFeedbackBorder urlBorder = new FormComponentFeedbackBorder("urlBorder");
                item.add(urlBorder);
                TextField format = new TextField("format", new PropertyModel(item.getModel(), "type"));
                format.setRequired(true);
View Full Code Here

        setModel(new CompoundPropertyModel(new ServiceAccessRule(rule)));

        // build the form
        form = new Form("ruleForm");
        add(form);
        form.add(service = new DropDownChoice("service", getServiceNames()));
        service.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                method.setChoices(new Model(getMethod((String) service.getConvertedInput())));
                method.modelChanged();
                target.addComponent(method);
            }
        });
        setOutputMarkupId(true);
        form.add(method = new DropDownChoice("method", getMethod(rule.getService())));
        method.setOutputMarkupId(true);

        form.add(rolesForComponent = new RolesFormComponent("roles", new RolesModel(rule), form,
                true));
View Full Code Here

        }
       
       
       
        // the root chooser
        final DropDownChoice choice = new DropDownChoice("roots", new Model(selectionRoot), new Model(roots), new FileRenderer());
        choice.add(new AjaxFormComponentUpdatingBehavior("onchange") {

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                File selection = (File) choice.getModelObject();
                breadcrumbs.setRootFile(selection);
                updateFileBrowser(selection, target);
            }
           
        });
        choice.setOutputMarkupId(true);
        add(choice);
       
        // the breadcrumbs
        breadcrumbs = new FileBreadcrumbs("breadcrumbs", new Model(selectionRoot), file) {
View Full Code Here

         * (/src/test/resources/test-data/demo-requests in this case)
         */
        final List<String> expectedList = Arrays.asList(new String[] { "WFS_getFeature-1.1.xml",
                "WMS_describeLayer.url" });

        DropDownChoice dropDown = (DropDownChoice) tester
                .getComponentFromLastRenderedPage("demoRequestsForm:demoRequestsList");
        List choices = dropDown.getChoices();
        assertEquals(expectedList, choices);
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.form.DropDownChoice

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.