Thursday, March 31, 2011

Re: access a <form> from a JSNI function in GWT

Now I have this in JSNI:

var formData = new
FormData(this.@com.libregeosocial.backend.client.tools.RequestJson::fileinfo);

And fileinfo is a FormPanel. But this crash ... any Idea? is not the
same a FormData javascript and a FormPanel Java ?!

On 31 mar, 13:08, mightymightyblues <mightymightybl...@gmail.com>
wrote:
> So, I create a :
> <g:FormPanel enctype="multipart/form-data" method="post"
> name="fileinfo" ui:field="fileinfo">
>    <input type="file" name="file"/>
> </g:FormPanel>
>
> use the uiBinde to take te FormPanel, and after that I can to use that
> "FormPanel" like a FormData in jsni? Is compatible?
>
> On 31 mar, 12:01, Thomas Broyer <t.bro...@gmail.com> wrote:
>
>
>
>
>
>
>
> > If the form is in a ui.xml, why don't you put a ui:field on it (instead of
> > id) and have uiBinder inject the FormElement into an @UiField of your Java
> > class? (and then pass the FormElement ro your JSNI method instead of the
> > getElementById)
>
> > But back to your actual issue with JSNI: use '$doc' instead of 'document'.
> > GWT by default loads in a hidden iframe, so the 'document' is the iframe's
> > doc, not the host page's one.

--
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-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment