Package org.apache.wicket.behavior

Examples of org.apache.wicket.behavior.SimpleAttributeModifier


            fragment = new Fragment("frag", "editor", this);

            TextField field = new TextField("component", model, metaData.getPropertyType());
           
            if (advOnEnter) {
                field.add( new SimpleAttributeModifier("onkeypress", "return inputField_HandleEnter(this, event)") );
            }
           
            setFieldParameters(field);
            fragment.add(field);
        }
View Full Code Here


   
    protected void setFieldParameters(FormComponent field)
    {
        Integer maxLength = getMaxLength();
        if (maxLength != null) {
            field.add( new SimpleAttributeModifier("maxlength", maxLength.toString()) );
        }
       
        String defaultValue = getDefaultValue();
        if (defaultValue != null && Strings.isEmpty(getDefaultModelObjectAsString())) {
            field.setModelValue(defaultValue);
View Full Code Here

                }
            });
        }
       
        if (Boolean.valueOf(isDefault)) {
            button.add( new SimpleAttributeModifier("id", "bfDefaultButton") );
        }

        button.setOutputMarkupId(true);
        add(button);
        button.add(label);
View Full Code Here

           
            Component component;
            if (element.isAction()) {
                Form form = findParent(Form.class);
                component = new BeanActionButton("c", element, form, bean);
                item.add( new SimpleAttributeModifier("class", "beanActionButtonCell") );
            }
            else {
                component = beanMetaData.getComponentRegistry().getComponent(bean, "c", element);
                if (!(component instanceof UnlabeledField) && showLabels) {
                    component = new LabeledField("c", element.getLabelComponent("l"), component);
View Full Code Here

        {
            ElementMetaData element = (ElementMetaData)item.getModelObject();
           
            if (element.isAction()) {
                Form form = findParent(Form.class);
                item.add( new SimpleAttributeModifier("class", "beanActionButtonCell") );
                item.add( new Label("l", "") );
                item.add( new BeanActionButton("c", element, form, bean) );
            }
            else {
                item.add(showLabels ? element.getLabelComponent("l") : new Label("l", ""));
View Full Code Here

                    FormSubmitter behavior = new FormSubmitter("onchange");
                    // Note: Do NOT set a delay. The delay can cause an onchange to be sent AFTER a button submit
                    // which causes the submit button's messages to be erased. <- That was true when we used AjaxSubmitButtons, we don't anymore.
                    //behavior.setThrottleDelay(Duration.milliseconds(250));
                    component.add(behavior);
                    component.add( new SimpleAttributeModifier("onfocus", "bfOnFocus(this)") );
                }
            }
           
            return IVisitor.CONTINUE_TRAVERSAL;
        }
View Full Code Here

          for (ISIResponse response : responseList) {
            WebMarkupContainer responseItem = new WebMarkupContainer(responses.newChildId());
            responseItem.setOutputMarkupId(true);
            responses.add(responseItem);
            responseItem.add(new WebMarkupContainer("responseAnchor")
                .add(new SimpleAttributeModifier("name", String.valueOf(response.getId()))));
            responseItem.add(new ResponseViewerFactory().makeResponseViewComponent("response", new HibernateObjectModel<ISIResponse>(Response.class, response.getId())));

            // Remove from Whiteboard link
            WhiteboardRemoveDialog removeModal = new WhiteboardRemoveDialog("removeModal", new ResponseModel(response));
            responseItem.add(removeModal);
View Full Code Here

     
      add(new StudentFlagPanel("studentFlagPanel", mUser.getObject(), flagMap).setVisible(!newStudent));

      TextField<String> lastName = new TextField<String>("lastName", new PropertyModel<String>(mUser, "lastName"));
      lastName.setRequired(true);
      lastName.add(new SimpleAttributeModifier("maxlength", "32"));
      add(lastName);
         
      TextField<String> firstName = new TextField<String>("firstName", new PropertyModel<String>(mUser, "firstName"));
      firstName.setRequired(true);
      firstName.add(new SimpleAttributeModifier("maxlength", "32"));
      add(firstName);

      // E-mail Address
      TextField<String> email = new TextField<String>("email", new PropertyModel<String>(mUser, "email"));
      email.add(EmailAddressValidator.getInstance());
      email.add(new UniqueUserFieldValidator(mUser, Field.EMAIL));
      add(email);

      TextField<String> userName = new TextField<String>("username", new PropertyModel<String>(mUser, "username"));
      userName.add(new SimpleAttributeModifier("maxlength", "32"));
      userName.setRequired(true);
      userName.add(new UniqueUserFieldValidator(mUser, Field.USERNAME));
      add(userName);
         
      // RSAPasswordTextField does not seem to work well with Ajax
      // TODO: Fix that
      PasswordTextField password = new PasswordTextField("password", new Model<String>()) {

        private static final long serialVersionUID = 1L;

        @Override
        public void updateModel() {
          if (getConvertedInput() != null) {
            ((EditStudentForm) getForm()).getModelObject().setPassword(getConvertedInput());
          }
          setModelObject(null);
        }
      };
      password.add(new SimpleAttributeModifier("maxlength", "32"));
      password.setRequired(mUser.getObject().isTransient());
      add(password);
     
      add(new AjaxSubmitLink("save") {
        private static final long serialVersionUID = 1L;
View Full Code Here

    public TitleFragment(String id, IModel<Response> model) {
      super(id, "titleFragment", ResponseEditor.this, model);
      setRenderBodyOnly(true);
      // resource keys are, for example, "response.title.prompt.audio"
      add(new Label("titleInstructions", new ResourceModel("response.title.prompt."+model.getObject().getType().getName().toLowerCase(), "Add a title")));
      add(new TextField<String>("title", new PropertyModel<String>(model, "title")).add(new SimpleAttributeModifier("maxlength", "250")));
    }
View Full Code Here

      TextField<String> periodName = new TextField<String>("name", new PropertyModel<String>(getModel(), "name"));
      add(periodName);
     
      // Ensure that no two periods in the same site have the same name.
      periodName.add(new UniqueDataFieldValidator<String>(getModel(), "name").limitScope("site", new PropertyModel<Site>(getModel(), "site")));
      periodName.add(new SimpleAttributeModifier("maxlength", "32"));
      periodName.setRequired(true);
     
      add(new AjaxFallbackLink<Object>("cancel") {
        private static final long serialVersionUID = 1L;
View Full Code Here

TOP

Related Classes of org.apache.wicket.behavior.SimpleAttributeModifier

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.