Thursday, March 31, 2011

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



On Thursday, March 31, 2011 1:08:26 PM UTC+2, mightymightyblues 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>

Why a FormPanel?
<form ui:field="fileinfo" ...>
and
@UiField com.google.gwt.dom.client.FormElement fileinfo;
(you can also just use a com.google.gwt.dom.client.Element)

I'd then give it as an argument to the JSNI method rather than accessing the field from JSNI, but that's just a matter of personal taste (just that the JSNI is more readable IMO)

--
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