when i use this code everything works fine.

SUCCESS====================================
public class PickupLocation extends Composite{

        private static PickupLocationUiBinder uiBinder = GWT
                        .create(PickupLocationUiBinder.class);

        interface PickupLocationUiBinder extends UiBinder<Widget,
PickupLocation> {
        }

        @UiField
        TextBox streetNumber;
        TextBox streetName;
        //Button locateButton;

        public PickupLocation() {
                initWidget(uiBinder.createAndBindUi(this));

                final Button locateButton = new Button("Add");

                // Listen for mouse events on the Add button.
                locateButton.addClickHandler(new ClickHandler() {
              public void onClick(ClickEvent event) {
                locatePoint();
              }
            });
            }

        private void locatePoint() {
            // TODO Auto-generated method stub
                }

}


but when i change the code to use my "button" from uiBinder xml file
it gives me a null pointer error.

FAILS===========================
public class PickupLocation extends Composite{

private static PickupLocationUiBinder uiBinder = GWT
                        .create(PickupLocationUiBinder.class);

interface PickupLocationUiBinder extends UiBinder<Widget,
PickupLocation> {
        }

        @UiField
        TextBox streetNumber;
        TextBox streetName;
        Button locateButton;

        public PickupLocation() {
                initWidget(uiBinder.createAndBindUi(this));

                // Listen for mouse events on the Add button.
                locateButton.addClickHandler(new ClickHandler() {
              public void onClick(ClickEvent event) {
                locatePoint();
              }
            });
            }

        private void locatePoint() {
            // TODO Auto-generated method stub
                }

}

=============================
here the code from my ui.xml file
<g:customCell><g:Button ui:field="locateButton">Locate </g:Button></
g:customCell>

any help would be appreciated.

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