AJAX and forms highlight some issues with HTML forms in general.  Unless
you have declared a brand new form for your modal popup, and are
absolutely sure that you are submitting that new form, you will be
submitting the original form that was on the base page.  Keep in mind
that to the browser, the modal "popup" is part of the same DOM as the
information beneath what the user sees--unless you actually created a
new window.

Browsers do not do well with forms embedded in forms, and they cause all
kinds of issues.  Make sure that YUI did not manufacture a DIV inside
the original form.  If it did, then your browser is defaulting to
sending the outermost form.  Use Firebug to inspect the DOM.

-----Original Message-----
From: Corbin, James [mailto:jcor...@iqnavigator.com] 
Sent: Tuesday, December 29, 2009 1:43 PM
To: users@wicket.apache.org
Subject: Modal Popups and Forms

Hi,

 

I have a modal popup (implemented using YUI 2.8).  The modal popup
contains a form and the popup's markup is rendered (via YUI js)
explicitly to "document.body".

 

The reasoning for rendering the YUI javascript to document.body is to
address some issue we had with css inheritance that was causing
rendering issues (conflicts with default YUI skinning) when we render
the markup inline.

 

If I change the YUI popup javascript to render inline, the issue doesn't
happen, but I don't want to render the markup for the popup inline,
because it potentially inherits styling that interferes with the YUI
styling for the popup.  Rendering the markup to "document.body" solves
that issue.

 

So what I know so far that I cannot change, or don't want to change, is
that the YUI popup implementation needs to render its markup to
"document.body".  

 

I verified that the markup generated for the popup's form is indeed a
div element (outside of the form tags as I would have expected)  In this
case, there is only one form tag (parent form where popup is initiated
from) on the page and it is indeed has its encoding set to multi-part
(verified in the generated markup).

 

Note the markup for the popup dialog does not have any elements that
should require multi-part encoding, but the parent form from which the
popup was initiated, does.

 

How come when I "submit" the dialog, I get the following exception?  I
guess I'm not sure what is going on and how Wicket is handling this
case.

 

java.lang.IllegalStateException: ServletRequest does not contain
multipart content
at
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init
>(MultipartServletWebRequest.java:113)
at
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init
>(MultipartServletWebRequest.java:83)
at
org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWe
bRequest(ServletWebRequest.java:500)
at
org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1651)
at
org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:850)
at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmi
tBehavior.java:135)

 

 

 

Ideas?

 

 

 

 

 

J.D. Corbin | IQNavigator, Inc. | Technology 6465 Greenwood Village
Blvd, Suite 800, Centennial, CO  80111 | Office 303.563.1503 | Mobile
303.912.0958 | www.iqnavigator.com | jcor...@iqnavigator.com

 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to