sorry for the last post - i wasn't ready when i send...
so again - you can also try:
public class MyButton extends Composite {
interface MyButtonUiBinder extends UiBinder<PushButton, MyButton>
{}
public static MyButtonUiBinder uiBinder =
GWT.create(MyButtonUiBinder.class);
private final PushButton button;
public SelectedButton() {
button = uiBinder.createAndBindUi(this);
initWidget(button);
}
so you don't need the ui:field in the ui.xml
public void setText(String text){
button.setText(text);
}
On 28 Apr., 18:38, Ulon <[email protected]> wrote:
> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group
> athttp://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.