Hello,
I'm using GWT SDK 2.4.0 and I'm trying to create an abstract class ( 
AbstractContentView ) that will be extended by Content1.
AbstractContentView  will have common code and uiFilds (like buttons etc.)
Content1 will had himself to AbstractContentView using 
"setContentWidget(this);"
But I'm getting the following error:
"[ERROR] Method 'previous' can not be bound. You probably missed 
ui:field='uiPrevious' in the template."
Can anyone please tell me what am I doing wrong?

Thanks,
Luis.

-- 
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/-/2M5hDn5TvJkJ.
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.

package com.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;

public abstract class AbstractContentView extends Composite {

	
	@UiField SimplePanel uiMain;
	
	@UiField Button uiPrevious;
	@UiField Button uiOk;
	@UiField Button uiNext;
	
	private static BaseContentViewUiBinder uiBinder = GWT
			.create(BaseContentViewUiBinder.class);

	interface BaseContentViewUiBinder extends UiBinder<Widget, AbstractContentView> {
	}

	public AbstractContentView() {
		initWidget(uiBinder.createAndBindUi(this));
	}

	
	public void setContentWidget(Widget widget){
		uiMain.add(widget);
	}
	
	public void setContentWidget(IsWidget widget){
		uiMain.add(widget);
	}


	@UiHandler("uiPrevious")
    void previous(ClickEvent e) {
		onPrevious();
    }

    @UiHandler("uiOk")
    void ok(ClickEvent e) {
    	onOk();
    }
    
    @UiHandler("uiNext")
    void next(ClickEvent e) {
    	onNext();
    }
	
	public abstract void onPrevious();
    public abstract void onOk();
    public abstract void onNext();
	
	
	
}

Attachment: AbstractContentView.ui.xml
Description: XML document

package com.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class Content1 extends AbstractContentView {

//	@UiField VerticalPanel uiPanel;
	
	private static Content1UiBinder uiBinder = GWT
			.create(Content1UiBinder.class);

	interface Content1UiBinder extends UiBinder<Widget, Content1> {
	}

	public Content1() {
		super();
		
		initWidget(uiBinder.createAndBindUi(this));
		
		setContentWidget(this);
//		setContentWidget(uiPanel);
	}

	@Override
	public void onPrevious() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onOk() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onNext() {
		// TODO Auto-generated method stub
		
	}

}

Attachment: Content1.ui.xml
Description: XML document

Reply via email to