Hi,
How can I access event from another widget?
Or I want to implement an event from another widget.
let say I have a three class:
iCombo.java = contain listbox
ComboParent.java = contain iCombo class
MainMenu.java = contain ComboParent

in the MainMenu.java class, I want to implement the event when the
listbox (in iCombo class) has changed.

please help me

best regards

/****************
* iCombo.java
****************/
public class iCombo extends Composite implements ChangeListener {
    private HorizontalPanel hPanel = new HorizontalPanel();
    private ListBox ListA = new ListBox();
    private ListBox ListB = new ListBox();
    private ListBox ListC = new ListBox();

    public iCombo () {
        hPanel.add(ListA);
        hPanel.add(ListB);
        hPanel.add(ListC);

        ListA.addChangeListener(this);
        ListB.addChangeListener(this);
        ListC.addChangeListener(this);

        initWidget(hPanel);
    }
    public void onChange(Widget sender) {
        // I want to implement this method from another class? :(
    }
}

/****************
* ComboParent.java
****************/
public class ComboParent extends Composite {
    private VerticalPanel vPanel = new VerticalPanel();
    private iCombo MyCombo = new iCombo();
    private Button btn1 = new Button("OK");
    private TextBox txt1 = new TextBox();

    public ComboParent() {
        vPanel.add(txt1);
        vPanel.add(MyCombo);
        vPanel.add(btn1);

        initWidget(vPanel);
    }
}

/****************
* MainMenu.java
****************/
public class MainMenu implements EntryPoint {
    private VerticalPanel vPanel = new VerticalPanel();
    private ComboParent cp = new ComboParent ();

    public void onModuleLoad() {
        vPanel.add(cp);

        RootPanel.get().add(cp);
    }

    // How do I know when the ListBox has Changed From here..
}


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