I have a Page that has a Form with some select boxes in it and, outside the
Form, I have three buttons (submit[AjaxSubmitButton], reset[AjaxLink],
cancel[AjaxLink]).

In Wicket 1.2.3  (Actually, I have been using the latest 1.2-SNAPSHOT
releases) The submit button works as advertised and submits the page.

In 1.3-incubating-SNAPSHOT (latest as of 13DEC2006 7am EST), the page fails
with the following exception:

wicket.WicketRuntimeException: Could not find Form parent for
[MarkupContainer [Component id = submit, page =
com.csc.aims.issuetracker.wicket.TestSelectionPage, path =
0:submit.TestSelectionPage$7, isVisible = true, isVersioned = false]]
        at wicket.markup.html.form.FormComponent.getForm(FormComponent.java:409)
        at wicket.markup.html.form.Form$5.component(Form.java:633)
        at wicket.MarkupContainer.visitChildren(MarkupContainer.java:749)
        at wicket.markup.html.form.Form.findSubmittingButton(Form.java:624)
        at wicket.markup.html.form.Form.onFormSubmitted(Form.java:333)
        at
wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:87)
        at wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:165)
        at
wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:225)
        at
wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:98)
        at
wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:64)
        at
wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents(AbstractCompoundRequestCycleProcessor.java:56)
        at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:912)
        at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:950)
        at wicket.RequestCycle.step(RequestCycle.java:1026)
        at wicket.RequestCycle.steps(RequestCycle.java:1100)
        at wicket.RequestCycle.request(RequestCycle.java:454)
        at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:243)
        at wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:122)

After consulting the Migration Wiki Page
(http://cwiki.apache.org/WICKET/migrate-13.html) it shows that both
AjaxSubmitButton and AjaxSubmitLink have changed to extend Button. 
(Actually, I checked AjaxSubmitLink and it does NOT extend button...).  But
according to the javadoc for AjaxSubmitButton, since you pass a form to the
constructor, you don't need to add the component to a Form object.  In
practice this was not true.  Once I added the button to the form, it worked
as advertised.

I'm guessing the change was necessary as a result of the hierarchy change of
AjaxSubmitButton, but maybe the Form arg is no longer needed since you must
add it to the Form object?

Chuck
-- 
View this message in context: 
http://www.nabble.com/AjaxSubmitButton-and-not-adding-it-to-a-Form-tf2815470.html#a7857386
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to