Wednesday, April 28, 2010

UIBinder, PushButton and nested ui:field problem

HI!
I have a problem understanding how UIBinder really works. Let me show
you the example I'm trying to run:

----------------
public class MyButton extends Composite {
interface MyButton UiBinder extends UiBinder<PushButton, MyButton>
{}
public static MyButton UiBinder uiBinder =
GWT.create(MyButton .class);

@UiField
DivElement content;

public SelectedButton() {
initWidget(uiBinder.createAndBindUi(this));
}
------------------

And my XML is like following:


----------------
...
<g:PushButton>
<g:upFace>
<div class="{style.nicestyling}"></div>
<div class="{style.morenicestyling}"></div>
<div ui:field="content"></div>
</g:upFace>
</g:PushButton>
....
(i've omited part of the XML that isn't necessary)
----------------


Now, If I try to compile that I get some specially unhelpful
exception: java.util.NoSuchElementException: null

Apparently, it's because I have a "ui:field" inside the
<g:PushButton>. In case that is not allowed, how can I design a button
using UIBinder and make the button name dynamic?

Thanks people :-)

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