Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • mgallagher
    replied
    Here we go

    Worked it out.

    So if you want multiple controls to use the same handler with UIBinder this is how:

    Code:
    @UiHandler(value = {"txtText", "selType"})
    public void onEditFieldClicked(KeyDownEvent e) {
        SC.say("Key down!");
    }

    Leave a comment:


  • mgallagher
    replied
    My thoughts exactly

    Great point. I guess what I was hoping was the ability to do something like this:

    Code:
    @UiHandler("txtOne, txtTwo, txtThree")
    public void onEditFieldClicked(RecordClickEvent e) {
        SC.say("Value changed");
    }

    Leave a comment:


  • Blama
    replied
    Hi mgallagher,

    I'm not perfectly sure here, but did you try to use handler objects instead of anonymous classes, so instead of:
    Code:
    widget1.addABCHandler(new ABCHandler() {
    	@Override
    	public void onABC(ABCEvent event) {
    		...
    		...
    	}
    });
    widget2.addABCHandler(new ABCHandler() {
    	@Override
    	public void onABC(ABCEvent event) {
    		...
    		...
    	}
    });
    use:
    Code:
    ABCHandler myHandler = new ABCHandler() {
    	@Override
    	public void onABC(ABCEvent event) {
    		...
    		...
    	}
    });
    widget1.addABCHandler(myHandler);
    widget2.addABCHandler(myHandler);
    widget3.addABCHandler(myHandler);
    ?

    Best regards,
    Blama

    Leave a comment:


  • UIBinder - Link multiple controls to the same event handler

    So I've got several tabs and a number of controls on each. When a user modifies the value of one of the controls I would like to enable a save button (which otherwise would be disabled).

    Is there anyway for me to link multiple controls to the same event handler, such as the value changed event?
Working...
X