I have the below block of code. A Link or an AjaxLink works perfectly here
inside a WebMarkupContainer. But when I use an AjaxButton (with a
setDefaultFormProcessing=False), I get an error. Thanks

                AjaxButton linkCopy = new AjaxButton("linkCopy") {

                        @Override
                        protected void onSubmit(AjaxRequestTarget arg0, Form<?> 
arg1) {
                                // TODO Auto-generated method stub
                                
                        }                       
                };
                linkCopy.setDefaultFormProcessing(false);
                wmcMarkup.add(linkCopy);

Error:
java.lang.IllegalStateException: form was not specified in the constructor
and cannot be found in the hierarchy of the component this behavior is
attached to
        at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.getForm(AjaxFormSubmitBehavior.java:92)
        at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.getEventHandler(AjaxFormSubmitBehavior.java:108)
        at
org.apache.wicket.ajax.markup.html.form.AjaxButton$1.getEventHandler(AjaxButton.java:131)
        at
org.apache.wicket.ajax.AjaxEventBehavior.onComponentTag(AjaxEventBehavior.java:111)
        at
org.apache.wicket.behavior.AbstractAjaxBehavior.onComponentTag(AbstractAjaxBehavior.java:134)
        at org.apache.wicket.Component.renderComponentTag(Component.java:4009)
        at org.apache.wicket.Component.renderComponent(Component.java:2610)




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxButton-doesn-t-work-in-WebMarkupContainer-tp4657633.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to