form submit new window ... request getparameter not working???

81 views
Skip to first unread message

bhara...@gmail.com

unread,
Dec 30, 2008, 10:35:14 PM12/30/08
to Google Web Toolkit
Hi,
I have a GWT form and I submit the form to a spring controller. The
form submit should open in new window. I have a hiddenvalue in form
that I submit with form. My issue is that form opens a new window but
when i do request.getParameter("...") I dont get my hidden value. Can
somebody please help?



final FormPanel form = new FormPanel("_blank");
form.setAction( hostPrefix + "/someform/" );
form.setMethod( FormPanel.METHOD_GET );

Panel rfpMainPanel = new FlowPanel();

rfpMainPanel.add( form );

Panel rfpPanel = new VerticalPanel();

form.setWidget(rfpPanel);

final Hidden hiddenValue = new Hidden("multiple", "testValue");
rfpPanel.add( hiddenValue );

form.addFormHandler( new FormHandler() {
public void onSubmit(FormSubmitEvent event) {
Window.alert( hiddenValue.getValue() );
}
public void onSubmitComplete(FormSubmitCompleteEvent event) {

}
});

Image goToRfpForm = new Image();

goToRfpForm.addClickListener( new ClickListener() {
public void onClick( Widget sender )
{
form.submit();
}
} );

rfpPanel.add( goToRfpForm );

Thanks
Bharat

Sam Wells

unread,
Jan 6, 2009, 1:43:22 AM1/6/09
to Google Web Toolkit
Try this . It worked for me
form.setEncoding(FormPanel.ENCODING_URLENCODED);//ENCODING_MULTIPART);

Thanks
Sam

On Dec 31 2008, 8:35 am, "bharat.j...@gmail.com"
<bharat.j...@gmail.com> wrote:
> Hi,
>  I have a GWT form and Isubmitthe form to a spring controller. The
> formsubmitshould open in new window. I have a hiddenvalue in form
> that Isubmitwith form. My issue is that form opens a new window but
> when i do request.getParameter("...") I dont get my hidden value. Can
> somebody please help?
>
> finalFormPanelform = newFormPanel("_blank");
>     form.setAction( hostPrefix + "/someform/" );
>     form.setMethod(FormPanel.METHOD_GET );
Reply all
Reply to author
Forward
0 new messages