On 17 oct, 17:24, djd <[email protected]> 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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to