hi
just a few tips,
  to prevent the form opening in new window ... set the "target" as
you do on links (<a ></a>), try form.setTarget("_self"); or something
like that.

if the code that makes the form and submits it could/should be execute
several time ... you could try makeing the form an private property on
some object for your convenience, and in the moment you do the
"action" that adds the the form ... you "remove"/"clear" the old form,
and set it with the new form ...


hope it helps ... excuse my English and the lack of the details I'm in
a bit of a hurry. I'll come back with more if you'll need



On Dec 30, 6:08 am, amjibaly <amjib...@gmail.com> wrote:
> I was just exploring using the form option, I know RPC is better in
> most situations. Just to clarify on your response, do you mean that
> adding an arbitrary number of 'invisible' forms (just used to submit
> requests) to the RootPanel will not cause any performance issues? In
> other words, do i ever have to remove the forms I add to the root
> panel if they are invisible? If so, what is the best approach to do
> that?
>
> Thanks
>
> On Dec 29, 4:50 pm, rjcarr <rjc...@gmail.com> wrote:
>
> > I hate it when people answer questions with other questions, but why
> > would you do this?
>
> > Since the form is hidden the user would have no way to submit it,
> > rendering it useless.  If you want to communicate with the server,
> > simply set up and use an RPC.
>
> > Attempting to answer your questions ...
>
> >  1) Yes, I would think the form would need to be added to the
> > RootPanel to be functional.
>
> >  2) If you want to submit this form then yes, it will need to be added
> > (directly or indirectly) to the RootPanel.  The is no "memory leak" in
> > submitting a form.
>
> > On Dec 28, 11:20 pm, amjibaly <amjib...@gmail.com> wrote:
>
> > > Hi,
>
> > > I've been playing around with sending an "invisible" form using
> > > FormPanel:
>
> > > FormPanel form = new FormPanel();
> > > form.setAction(url);
> > > form.setMethod(FormPanel.METHOD_POST);
> > > form.setEncoding(FormPanel.ENCODING_URLENCODED);
> > > form.add(new Hidden("abc", "xyz"));
> > > form.addSubmitCompleteHandler(new SubmitCompleteHandler() {...});
> > > form.setVisible(false);
> > > RootPanel.get().add(form);
>
> > > I have a couple questions regarding this:
>
> > > 1- If I do not add the form to the RootPanel, the browser opens a new
> > > window for the response, and the SubmitCompleteHandler event is never
> > > fired. Is it necessary to add the form to the RootPanel to get the
> > > correct functionality?
>
> > > 2- If I do add the form to the RootPanel, would I have to somehow
> > > remove it later on? Since this code may be executed an arbitrary
> > > number of times would that cause a problem (memory leak or something)?
>
> > > Thanks,
> > > Abdullah
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to