AjaxFallbackButton , onclick Behaviour ist registered per Default for onSubmit 
Functionlaity
--------------------------------------------------------------------------------------------

                 Key: WICKET-4495
                 URL: https://issues.apache.org/jira/browse/WICKET-4495
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5.5
            Reporter: otto
            Priority: Minor


Why does AjaxFallbackButton register per default an onclick Behaviour,
and not an onsubmit behaviour ?
With this, FormTester.submit , emulating a submit Behaviour, does not find the 
correct beaviour to execute in 
WicketTesterHelper.findAjaxEventBehavior(Component component, String event)

Bug may be related to WICKET 2783 ?


public AjaxFallbackButton(String id, IModel<String> model, Form<?> form)
        {
                super(id, model);
                mForm = form;

                add(new AjaxFormSubmitBehavior(form, "onclick")
                {
                        private static final long serialVersionUID = 1L;

                        @Override
                        protected void onSubmit(AjaxRequestTarget target)
                        {
                                AjaxFallbackButton.this.onSubmit(target, 
AjaxFallbackButton.this.getForm());
                        }

                        @Override
                        protected void onError(AjaxRequestTarget target)
                        {
                                AjaxFallbackButton.this.onError(target, 
AjaxFallbackButton.this.getForm());
                        }

                        @Override
                        protected CharSequence getEventHandler()
                        {
                                return new 
AppendingStringBuffer(super.getEventHandler()).append("; return false;");
                        }

                        @Override
                        protected IAjaxCallDecorator getAjaxCallDecorator()
                        {
                                return 
AjaxFallbackButton.this.getAjaxCallDecorator();
                        }

                        @Override
                        protected AjaxChannel getChannel()
                        {
                                return AjaxFallbackButton.this.getChannel();
                        }

                        @Override
                        public boolean getDefaultProcessing()
                        {
                                return 
AjaxFallbackButton.this.getDefaultFormProcessing();
                        }
                });
        }


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to