I don't know if you're right about thinking that there's still situation
where an HTMLPanel or layout panel, without uifield is the best way to go,
but I do know that we should use as often as possible html code instead of
widget for the very reason you exposed.

BUT I'm still wondering if once compiled to JS those instanciations are
translated to plain html. It's not clear in what you're saying if it's in
production or in development mode.

Christian

On Thu, Apr 15, 2010 at 9:44 AM, plcoirier <plcoir...@gmail.com> wrote:

> With UiBinder, I thought that GWT compiler would prevent instantiation
> of widget with no ui:field attribute by directly inserting the html
> code of the widget.
>
> In other words, I thought that:
>
>        <g:VerticalPanel>
>                <g:HorizontalPanel><g:Label>Line
> 1</g:Label></g:HorizontalPanel>
>                <g:HorizontalPanel><g:Label>Line
> 2</g:Label></g:HorizontalPanel>
>        </g:VerticalPanel>
>
> would give the same result as:
>
>        <g:HTMLPanel>
>                <table>
>                        <tr>
>                                <td>Line1</td>
>                                <td>Line2</td>
>                        </tr>
>                </table>
>        </g:HTMLPanel>
>
> But in the first case, it generates this Java code:
>    com.google.gwt.user.client.ui.Label f_Label3 =
> (com.google.gwt.user.client.ui.Label)
> GWT.create(com.google.gwt.user.client.ui.Label.class);
>    com.google.gwt.user.client.ui.HorizontalPanel f_HorizontalPanel2 =
> (com.google.gwt.user.client.ui.HorizontalPanel)
> GWT.create(com.google.gwt.user.client.ui.HorizontalPanel.class);
>    com.google.gwt.user.client.ui.Label f_Label5 =
> (com.google.gwt.user.client.ui.Label)
> GWT.create(com.google.gwt.user.client.ui.Label.class);
>    com.google.gwt.user.client.ui.HorizontalPanel f_HorizontalPanel4 =
> (com.google.gwt.user.client.ui.HorizontalPanel)
> GWT.create(com.google.gwt.user.client.ui.HorizontalPanel.class);
>    com.google.gwt.user.client.ui.VerticalPanel f_VerticalPanel1 =
> (com.google.gwt.user.client.ui.VerticalPanel)
> GWT.create(com.google.gwt.user.client.ui.VerticalPanel.class);
>
>    f_Label3.setText("Line 1");
>    f_HorizontalPanel2.add(f_Label3);
>    f_VerticalPanel1.add(f_HorizontalPanel2);
>    f_Label5.setText("Line 2");
>    f_HorizontalPanel4.add(f_Label5);
>    f_VerticalPanel1.add(f_HorizontalPanel4);
>
> and the second case, it generates:
>    com.google.gwt.user.client.ui.HTMLPanel f_HTMLPanel1 = new
> com.google.gwt.user.client.ui.HTMLPanel("<table> <tr> <td>Line1</td>
> <td>Line2</td> </tr> </table>");
>
> So am I right to think that I should never use widget inside UiBinder
> xml except if I have the attribute ui:field (in other words, except if
> I need it in the Java code)?
>
> Thanks,
> Pierre
>
> --
> 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<google-web-toolkit%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

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