There is a post on this somewhere, I just don't have the link.

1) Make a form with all the inputs and a submit button (In your HTML).
The action can be javascript:void(0). Give the form an id.
2) Do FormPanel.wrap(Document.get().getElementById(formID)) to get the
form.
3) You can add a handler to the FormPanel for input validation.
4) Add a JSNI native that creates a javascript function to call (like
this 
http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html#calling).
The Java method it calls should grab the inputs you want. It will be
triggered by the submit button.
5) Call the above method
6) Change the FormPanel action to be javascript:[method name from step
4]

This doesn't work on Chrome though, because chrome needs a new page to
load so it knows the values were correct. Or something like that.

You can set the form to display:none, then add it as a widget to a
popup panel and remove the display:none. This way it will be hidden
till you need it.

On Dec 24, 3:24 am, skrat <dusan.malia...@gmail.com> wrote:
> It's the very basic browser feature, without any extensions.  Just
> click twice on input, or start typing in a field you have had already
> submitted before, and previous values will be offered for you. This is
> standard feature of FF, Chrome, and I guess some more browsers.
>
> On Dec 23, 5:59 pm, Michael W <mwang_2...@yahoo.com> wrote:
>
>
>
> > Skrat,
>
> > Are you talking about the Google Autofill, Roboform Autofill feature?
> > Which means browser remembers your form entry and next time once you
> > click Autofill from browser, the form is refilled.
>
> > Or just want to prepopulate your form processed by your program.
>
> > On Dec 22, 9:22 am, skrat <dusan.malia...@gmail.com> wrote:
>
> > > Hmm, that script inserted forms problem, might be fatal.
>
> > > I guess security should be handled by browsers, and all non-XHR forms
> > > are leveraging this feature. please
>
> > > On Dec 22, 3:07 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
>
> > > > On Dec 22, 2:53 pm, skrat <dusan.malia...@gmail.com> wrote:
>
> > > > > Hi all,
>
> > > > > I am curious about, how can one enable, or force a browser to remember
> > > > > value inside text inputs (TextBox) values. In browsers it basically
> > > > > works when you submit a form, then all values are remembered, and next
> > > > > time you open that form, you will be provided with autocomplete box.
> > > > > All major browsers works like this.
>
> > > > > Since in apps, that decides to use XML, JSON or GWT RPC, values in
> > > > > forms are actually not submitted, and thus not remebered. We just read
> > > > > those values and don't do any submit, we do XHR instead.
>
> > > > > Any ideas how to get back this very useful browser feature?
>
> > > > This is a hack but if you really want it:
> > > >  - use a form
> > > >  - expose a GWT method as a JS 'global' function (e.g.,
> > > > myExportedGwtMethod)
> > > >  - set the form's action to call the exported method
> > > > ("javascript:myExportedGwtMethod()")
> > > >  - do your XHR/RPC call from within your exported GWT method
>
> > > > Note that (I'm almost sure this isn't the case, for any form except
> > > > login forms, but just in case) this might only work if the form is
> > > > actually part of the original HTML markup of the page (i.e. not
> > > > inserted by script).
>
> > > > It's not worth it IMO; except for login forms eventually, even if it
> > > > goes against the most basic security rules, just because of the
> > > > enhanced UX.

--

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