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

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


            );
        }

        AttributionInfo attr = layer.getAttribution();

        add(new TextField("wms.attribution.title",
            new PropertyModel(model, "attribution.title")
        ));

        final TextField href = new TextField("wms.attribution.href",
            new PropertyModel(model, "attribution.href")
        );
        href.add(new UrlValidator());
        href.setOutputMarkupId(true);
        add(href);

        final TextField logo = new TextField("wms.attribution.logo",
            new PropertyModel(model, "attribution.logoURL")
        );
        logo.add(new UrlValidator());
        logo.setOutputMarkupId(true);
        add(logo);

        final TextField type = new TextField("wms.attribution.type",
            new PropertyModel(model, "attribution.logoType")
        );
        type.setOutputMarkupId(true);
        add(type);

        final TextField height = new TextField("wms.attribution.height",
            new PropertyModel(model, "attribution.logoHeight"),
            Integer.class
        );
        height.add(NumberValidator.minimum(0));
        height.setOutputMarkupId(true);
        add(height);

        final TextField width = new TextField("wms.attribution.width",
            new PropertyModel(model, "attribution.logoWidth"),
            Integer.class
        );
        width.add(NumberValidator.minimum(0));
        width.setOutputMarkupId(true);
        add(width);

        add(new AjaxSubmitLink("verifyImage") {
            protected void onSubmit(AjaxRequestTarget target, Form form) {
                if (logo.getModelObjectAsString() != null) {
                    try {
                        URL url = new URL(logo.getModelObjectAsString());
                        URLConnection conn = url.openConnection();
                        type.getModel().setObject(conn.getContentType());
                        BufferedImage image = ImageIO.read(conn.getInputStream());
                        height.setModelValue("" + image.getHeight());
                        width.setModelValue("" + image.getWidth());
                    } catch (Exception e) {
                    }
                }

                target.addComponent(type);
View Full Code Here


    }
   
    void initComponents() {
        updateFields();
       
        add( new TextField( "minX", new PropertyModel(this, "minX")) );
        add( new TextField( "minY", new PropertyModel(this, "minY")) );
        add( new TextField( "maxX", new PropertyModel(this, "maxX") ) );
        add( new TextField( "maxY", new PropertyModel(this, "maxY")) );
    }
View Full Code Here

                        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);
                item.add(format);
                TextField url = new TextField("metadataLinkURL", new PropertyModel(item.getModel(), "content"));
                url.add(new UrlValidator());
                url.setRequired(true);
                urlBorder.add(url);
               
                // remove link
                AjaxLink link = new AjaxLink("removeLink", item.getModel()) {
View Full Code Here

                    error(e.getMessage());
                }
            }
        };
        add(form);
        TextField name = new TextField("name", new PropertyModel(wsModel, "name"));
        name.setRequired(true);
        name.add(new XMLNameValidator());
        form.add(name);
        TextField uri = new TextField("uri", new PropertyModel(nsModel, "uRI"), String.class);
        uri.setRequired(true);
        uri.add(new URIValidator());
        form.add(uri);
        CheckBox defaultChk = new CheckBox("default", new PropertyModel(this, "defaultWs"));
        form.add(defaultChk);
       
        //stores
View Full Code Here

        form.setModel(new CompoundPropertyModel(userModel));
        setModel(userModel);
        add(form);
       
        // populate the form editing components
        username = new TextField("username");
        form.add(username);
        PasswordTextField pw1 = new PasswordTextField("password").setResetPassword(false);
        PasswordTextField pw2 = new PasswordTextField("confirmPassword").setResetPassword(false);
        form.add(pw1);
        form.add(pw2);
View Full Code Here

                setResponsePage(WorkspacePage.class );
            }
        };
        add(form);
       
        TextField nameTextField = new TextField("name");
        nameTextField.setRequired(true);
        nameTextField.add(new XMLNameValidator());
        form.add( nameTextField.setRequired(true) );
       
        nsUriTextField = new TextField( "uri", new Model() );
        // maybe a bit too restrictive, but better than not validation at all
        nsUriTextField.setRequired(true);
        nsUriTextField.add(new URIValidator());
        form.add( nsUriTextField );
       
View Full Code Here

        lgModel = new LayerGroupDetachableModel( layerGroup );
        layerGroupId = layerGroup.getId();
       
        Form form = new Form( "form", new CompoundPropertyModel( lgModel ) );
        add(form);
        TextField name = new TextField("name");
        name.setRequired(true);
        name.add(new GroupNameValidator());
        form.add(name);
       
        //bounding box
        form.add(envelopePanel = new EnvelopePanel( "bounds" )/*.setReadOnly(true)*/);
        envelopePanel.setRequired(true);
View Full Code Here

        choices = new ArrayList<String>((List<String>) choiceModel.getObject());

        rolePalette = rolesPalette(new PropertyModel(this, "choices"));
        rolePalette.setOutputMarkupId(true);
        add(rolePalette);
        add(newRoleField = new TextField("newRole", new Model()));
        newRoleField.setOutputMarkupId(true);
        add(addRoleButton(form));

    }
View Full Code Here

        tester.assertModelValue("demoRequestsForm:demoRequestsList", requestName);

        final String modifiedUrl = "http://modified/url";

        TextField url = (TextField) tester.getComponentFromLastRenderedPage("demoRequestsForm:url");
        url.setModelValue(new String[] { modifiedUrl });

        assertEquals(modifiedUrl, url.getValue());

        final boolean isAjax = true;
        tester.clickLink("demoRequestsForm:submit", isAjax);

        tester.assertVisible("responseWindow");
View Full Code Here

   */
  public StatelessPage()
  {
    setStatelessHint(true);
    add(new BookmarkablePageLink("indexLink", Index.class));
    final TextField field = new TextField("textfield", new Model());
    field.setRequired(true);

    StatelessForm statelessForm = new StatelessForm("statelessform")
    {
      private static final long serialVersionUID = 1L;

      /**
       * @see org.apache.wicket.markup.html.form.Form#onSubmit()
       */
      protected void onSubmit()
      {
        info("Submitted text: " + field.getDefaultModelObject());
      }
    };
    statelessForm.add(field);
    add(statelessForm);
    add(new FeedbackPanel("feedback"));
View Full Code Here

TOP

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

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.