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

Examples of org.apache.wicket.ajax.markup.html.form.AjaxButton


      super(id);
      add(new TextArea<String>("text", textModel)
          .add(new QuestionNameValidator(null))
          .setRequired(true)
          .add(new SimpleAttributeModifier("maxlength", "250")));
      add(new AjaxButton("submit") {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
          super.onSubmit();
View Full Code Here


        public boolean isVisible() {
          return editing;
        }       
      }.setRequired(true).add(new SimpleAttributeModifier("maxlength", "32")).setOutputMarkupPlaceholderTag(true));
     
      editContainer.add (new AjaxButton("save") {
        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
          return editing && !isTeacher;
View Full Code Here

    public NewWordForm(String id) {
      super(id);
      add(new TextArea<String>("wordText", mWord)
          .setRequired(true)
          .add(new SimpleAttributeModifier("maxlength", "50")));
      add(new AjaxButton("submit") {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
          String newWord = WordCard.normalizeWord(mWord.getObject());
View Full Code Here

                target.add(recipients);
                target.add(recipientsContainer);
            }
        });

        AjaxButton submit = new IndicatingAjaxButton("apply", new Model<String>(getString("submit"))) {

            private static final long serialVersionUID = -958724007591692537L;

            @Override
            protected void onSubmit(final AjaxRequestTarget target, final Form form) {
View Full Code Here

            }
        };

        connectorPropForm.add(check);

        final AjaxButton submit = new IndicatingAjaxButton("apply", new Model(getString("submit"))) {

            private static final long serialVersionUID = -958724007591692537L;

            @Override
            protected void onSubmit(final AjaxRequestTarget target, final Form form) {
View Full Code Here

        // Resource security panel
        //--------------------------------
        form.add(new ResourceSecurityPanel("security", resourceTO));
        //--------------------------------

        final AjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("submit", "submit")) {

            private static final long serialVersionUID = -958724007591692537L;

            @Override
            protected void onSubmit(final AjaxRequestTarget target, final Form form) {
View Full Code Here

        } else {
            searchConditionList = getSearchCondWrappers(initNodeCond, null);
        }
        searchFormContainer.add(new SearchView("searchView", searchConditionList, searchFormContainer));

        AjaxButton addAndButton = new IndicatingAjaxButton("addAndButton", new ResourceModel("addAndButton")) {

            private static final long serialVersionUID = -4804368561204623354L;

            @Override
            protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {

                SearchCondWrapper conditionWrapper = new SearchCondWrapper();
                conditionWrapper.setOperationType(OperationType.AND);
                searchConditionList.add(conditionWrapper);
                target.add(searchFormContainer);
            }

            @Override
            protected void onError(final AjaxRequestTarget target, final Form<?> form) {
                target.add(searchFormContainer);
            }
        };
        addAndButton.setDefaultFormProcessing(false);
        searchFormContainer.add(addAndButton);

        AjaxButton addOrButton = new IndicatingAjaxButton("addOrButton", new ResourceModel("addOrButton")) {

            private static final long serialVersionUID = -4804368561204623354L;

            @Override
            protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
                SearchCondWrapper conditionWrapper = new SearchCondWrapper();
                conditionWrapper.setOperationType(OperationType.OR);
                searchConditionList.add(conditionWrapper);
                target.add(searchFormContainer);
            }

            @Override
            protected void onError(final AjaxRequestTarget target, final Form<?> form) {
                target.add(searchFormContainer);
            }
        };
        addOrButton.setDefaultFormProcessing(false);
        searchFormContainer.add(addOrButton);

        add(searchFormContainer);
    }
View Full Code Here

        final RoleAttributesPanel attributesPanel = new RoleAttributesPanel("attributesPanel", form, roleTO);

        form.add(attributesPanel);

        final AjaxButton submit = new IndicatingAjaxButton("submit", new ResourceModel("submit")) {

            private static final long serialVersionUID = -958724007591692537L;

            @Override
            protected void onSubmit(final AjaxRequestTarget target, final Form form) {
View Full Code Here

                }
            });
            filterTypeChooser.setRequired(required);
            item.add(filterTypeChooser);

            AjaxButton dropButton = new IndicatingAjaxButton("dropButton", new ResourceModel("dropButton")) {

                private static final long serialVersionUID = -4804368561204623354L;

                @Override
                protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
                    getList().remove(Integer.valueOf(getParent().getId()).intValue());
                    target.add(searchFormContainer);
                }

                @Override
                protected void onError(final AjaxRequestTarget target, final Form<?> form) {
                    target.add(searchFormContainer);
                }
            };
            dropButton.setDefaultFormProcessing(false);
            if (item.getIndex() == 0) {
                dropButton.setVisible(false);
            }
            item.add(dropButton);

            if (searchCondition == null || searchCondition.getFilterType() == null) {
                filterNameChooser.setChoices(Collections.EMPTY_LIST);
View Full Code Here

            }
        }


        private void addButtons() {
            AjaxButton okButton = new AjaxButton(ID_OK_BUTTON, new ResourceModel("okLabel")) {
                private static final long serialVersionUID = 1L;

                @Override
                public void onSubmit(AjaxRequestTarget target, Form<?> form) {
                    boolean succeeded = actionExecutor.executeActionAndProcessResults(target, form);
                    if(succeeded) {
                        // the Wicket ajax callbacks will have just started to hide the veil
                        // we now show it once more, so that a veil continues to be shown until the
                        // new page is rendered.
                        target.appendJavaScript("isisShowVeil();\n");

                        send(getPage(), Broadcast.EXACT, new IsisActionCompletedEvent(getActionModel(), target, form));

                        target.add(form);
                    } else {
                        if (actionPromptIfAny != null) {
                           
                            final StringBuilder builder = new StringBuilder();

                            // ensure any jGrowl errors are shown
                            // (normally would be flushed when traverse to next page).
                            String errorMessagesIfAny = JGrowlUtil.asJGrowlCalls(IsisContext.getMessageBroker());
                            builder.append(errorMessagesIfAny);

                            // append the JS to the response.
                            String buf = builder.toString();
                            target.appendJavaScript(buf);
                            target.add(form);
                        }
                    }
                };

                /**
                 * On validation error
                 */
                @Override
                protected void onError(AjaxRequestTarget target, Form<?> form) {
                    super.onError(target, form);
                    target.add(form);
                }
            };
            okButton.add(new JGrowlBehaviour());
            add(okButton);
           
            AjaxButton cancelButton = new AjaxButton(ID_CANCEL_BUTTON, new ResourceModel("cancelLabel")) {
                private static final long serialVersionUID = 1L;

                @Override
                public void onSubmit(final AjaxRequestTarget target, Form<?> form) {
                    if(actionPromptIfAny != null) {
                        actionPromptIfAny.closePrompt(target);
                    }
                }
            };
            // so can submit with invalid content (eg mandatory params missing)
            cancelButton.setDefaultFormProcessing(false);
            add(cancelButton);
           
            // TODO: hide cancel button if dialogs disabled, as not yet implemented.
            if(ActionPromptModalWindow.isActionPromptModalDialogDisabled()) {
                cancelButton.setVisible(false);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.wicket.ajax.markup.html.form.AjaxButton

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.