Thanks!
I tried using the @UiField to access the HeaderPanel and change the
content, but when the searchButton is clicked, the content area becomes
blank and doesn't show my label. Any ideas why?
@UiField
HeaderPanel headerPanel;
@UiField
TextBox queryInput;
@UiField
Button searchButton;
@UiField
UListElement results;
public MyHeaderPanel() {
headerPanel = ( HeaderPanel ) uiBinder.createAndBindUi( this );
initWidget(headerPanel);
queryInput.getElement().setId("queryInput");
}
@UiHandler("searchButton")
void buttonClick(ClickEvent event) {
headerPanel.setContentWidget( new Label( "new results.... blah blah blah" )
);
}
On Friday, July 13, 2012 11:58:14 AM UTC-7, Jens wrote:
>
> In your java file you can call getWidget() to get the HeaderPanel, so you
> would probably define:
>
> private HeaderPanel getHeaderPanel() {
> return (HeaderPanel) getWidget();
> }
>
> Alternatively you could assign a ui:field to your HeaderPanel and use
> @UiField in your java file to access it. Or you could change your UiBinder
> interface definition and constructor a bit so you have:
>
> interface MyUiBinder extends UiBinder<HeaderPanel, MyHeaderPanelWidget> {}
> private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
>
> public MyHeaderPanelWidget() {
> HeaderPanel headerPanel = uiBinder.createAndBindUi(this);
> initWidget(headerPanel);
> }
>
>
>
> -- J.
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/DO93uAxyJz4J.
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.