Saturday, October 17, 2009

Re: UiBinder in GWT 2.0 MS1 and cell alignment

On 17 oct, 17:24, djd <alex.dobjans...@gmail.com> wrote:
> Hi everybody,
>
> Has anyone used UiBinder with the new alignment functionality? I mean
> setCellHorizontalAlignment, setCellVerticalAlignment. I tried to use
> them like this:
>
> <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
>              xmlns:g ='urn:import:com.google.gwt.user.client.ui'>
>   <g:HorizontalPanel styleName='accountPanel'>
>         <g:Button ui:field='checkBtn' horizontalAlignment='ALIGN_MIDDLE'
> addStyleNames='checkIcon' />
>         // .... other fields here
>   </g:HorizontalPanel>
> </ui:UiBinder>
>
> The error that I receive in Hosted Mode is : class Button has no
> appropriate setHorizontalAlignment() method, which couldn't be more
> accurate. However, the parent is HorizontalPanel which instead extends
> CellPanel and this class now has a custom parser in UiBinder, that
> handles horizontaAlignment/verticalAlignment tags.
>
> Did anyone use these features successfully? Can you provide me with a
> simple use-case xml sample?

This should work:
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g ='urn:import:com.google.gwt.user.client.ui'>
<g:HorizontalPanel styleName='accountPanel'>
<g:Cell horizontalAlignment='ALIGN_MIDDLE'>
<g:Button ui:field='checkBtn' addStyleNames='checkIcon' />
</g:Cell>
// .... other fields here
</g:HorizontalPanel>
</ui:UiBinder>

Though I believe the overall idea is to deprecate CellPanels
(HorizontalPanel, VerticalPanel) in favor of a "plain old HTML
table":
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g ='urn:import:com.google.gwt.user.client.ui'>
<g:HTMLPanel>
<table class='accountPanel'>
<tr>
<td align="center">
<g:Button ui:field='checkBtn' addStyleNames='checkIcon' />
</td>
</tr>
// .... other fields here
</g:HTMLPanel>
</ui:UiBinder>

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate