Announcement

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

    expected behavior of addDataArrivedHandler

    What is the expected behavior of addDataArrivedHandler if a DataArrivedHandler has already been registered to a grid ? i.e. :
    Code:
    grid.addDataArrivedHandler(new DataArrivedHandler() {
    
    			@Override
    			public void onDataArrived(DataArrivedEvent event) {
    			// do stuff	
    			}
    		}); 
    grid.addDataArrivedHandler(new DataArrivedHandler() {
    
    			@Override
    			public void onDataArrived(DataArrivedEvent event) {
    			// do more stuff	
    			}
    		});
    Should both handlers be firing? or does the 2nd call replace the first handler? I'm using the 01/13 nightly build of SmartGWT4.1d if that is relevant.

    thanks,
    dan

    #2
    This would appear to be an issue in my code. If I elaborate on the snippet I posted earlier my issue becomes clear:
    Code:
    TreeGrid grid = new TreeGrid();
    grid.addDataArrivedHandler(new com.smartgwt.client.widgets.tree.events.DataArrivedHandler() {
    
    			@Override
    			public void onDataArrived(com.smartgwt.client.widgets.tree.events.DataArrivedEvent event) {
    			// do stuff	
    			}
    		}); 
    grid.addDataArrivedHandler(new com.smartgwt.client.widgets.grid.events.DataArrivedHandler() {
    
    			@Override
    			public void onDataArrived(com.smartgwt.client.widgets.grid.events.DataArrivedEvent event) {
    			// do more stuff	
    			}
    		});
    It seems that adding the ListGrid DataArrivedHandler prevents the TreeGrid DataArrivedHandler from firing. When I change my code to make the 2nd dataArrivedHandler of the correct ( tree.event ) type, both handlers fire as expected.

    Comment

    Working...
    X