Hi,
What do you think about that way :
----SearchForm.ui.xml----
<g:FormPanel styleName="search form" action="" method="post">
<g:HTMLPanel>
<fieldset>
...
</fieldset>
</g:HTMLPanel>
</g:FormPanel>
--------
----SearchForm.java----
public class SearchForm extends Composite {
interface Binder extends UiBinder...
private static final Binder binder = GWT.create...;
private FormPanel form;
public SearchForm() {
form = binder.createAndBind(this);
initWidget(form);
}
}
--------
This ensures you don't break the event handling. You can also replace
<input..> by <g:TextBox...> and <button...> by <g:Button...>. These
two classes generate clean HTML.
If you really want to continue with your way, you have to deal with
widgets internal like sinkEvents, adopt, onAttach...
Olivier
On 16 juin, 19:13, Thiago Miranda de Oliveira <[email protected]>
wrote:
> Hi.. Here in my company we've decided to adopt the GWT for a working
> project but we are facing a huge barrier. Gwt has it's own widgets but
> they won't be used for their HTML/CSS produced that is almost
> impossible to "transform" in our design and HTML/CSS needs.
> So we've decided to create our own Widgets using the Ui Binder. So
> I've tried to do this:
> panelSearch.ui.xml:
>
> <g:HTMLPanel ui:field="searchForm">
> <form class="search form" action="" method="post">
> <fieldset>
> <legend class="hidden">Search results</legend>
> <div class="grid-12-12">
> <label class="form-lbl">Busca:</label>
> <input type="text" id="search-field"
> title="Busca" tabindex=""
> class="form-txt form-small" />
> <label class="form-lbl">Filtrar por
> data</label>
> <input type="text" title="Filtrar por
> data" tabindex=""
> class="form-txt form-date" />
> <input type="text" title="até"
> tabindex="" class="form-txt form-
> date" />
> <button ui:field="buttonOk"
> type="submit" title="Ok" tabindex=""
> class="form-button form-left button">ok</button>
> <a title="Adicionar projeto"
> href="upload-projeto.html"
> class="add-project button right"><span>Adicionar projeto</span></a>
> </div>
> </fieldset>
> </form>
> </g:HTMLPanel>
>
> And then I've created a Widget that extends the FormPanel and tried,
> mapped it and tried to use the getWidgetContainer inside the
> panelSearch.java to replace it with my class that extends the
> FormPanel. It replaced well but I can't get the events ( like
> submitHandler ). How can I do that? Is there a way?
>
> Thanks for the attention
> Cheers
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.