If you want to set the class name you need to use styleName or addStyleNames instead of class.
Hope that helps. -- Arthur Kalmenson On Wed, Jan 6, 2010 at 3:04 PM, John <[email protected]> wrote: > I thought I'd try to figure out UiBinder, but I'm lost. Played with > various tutorials and examples and finally I have striped things down > to what I believe is the bare minimum. > > It started as the standard Eclipse plugin generated application, and I > have discarded virtually everything. > > What's left is: > > public class TestUi implements EntryPoint { > > �...@uitemplate("TestUi.ui.xml") > interface TestBinder extends UiBinder<VerticalPanel, TestUi> { } > private static TestBinder testBinder = GWT.create(TestBinder.class); > > public void onModuleLoad() { > > VerticalPanel vp = testBinder.createAndBindUi(this); > RootPanel.get().add(vp); > } > } > ---------------------------------------------------------------------- > <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' > xmlns:g='urn:import:com.google.gwt.user.client.ui'> > > <ui:style> > .pretty { background-color: pink; } > </ui:style> > > <g:VerticalPanel class='{style.pretty}' > > </g:VerticalPanel> > > </ui:UiBinder> > ------------------------------------------------------------------------- > <?xml version="1.0" encoding="UTF-8"?> > <module rename-to='testui'> > <!-- Inherit the core Web Toolkit stuff. --> > <inherits name='com.google.gwt.user.User'/> > > <inherits name='com.google.gwt.user.theme.standard.Standard'/> > > <!-- Other module inherits --> > <inherits name="com.google.gwt.uibinder.UiBinder" /> > <!-- Specify the app entry point class. --> > <entry-point class='com.axxessible.testui.client.TestUi'/> > > <!-- Specify the paths for translatable code --> > <source path='client'/> > > </module> > ----------------------------------------------------------------------------- > errors during compile, the lines below are in exactly the sequence shown: > Invoking com.google.gwt.dev.javac.standardgeneratorcont...@45800894 > [ERROR] In <g:VerticalPanel class='{style.pretty}'>, > class VerticalPanel has no appropriate setClass() method > [ERROR] Errors in > 'file:/home/john/workspace/TestUi/src/com/axxessible/testui/client/TestUi.java' > [ERROR] Line 32: Failed to resolve > 'com.axxessible.testui.client.TestUi.TestBinder' via deferred binding > > If I take out the class='----' out of the <g:VerticalPanel> then it > compiles. But if it's a panel widget, it should be able to set a > background-color, no? > I already know I'm doing something incredibly stupid, so I don't mind > if you skip telling me that part, and just tell me what it is!! > Thanks. > > John > > -- > 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. > > > >
-- 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.
