Announcement

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

    [BUG] too many ItemChangedEvent raised by Clicking RadioGroupItem

    hi, all.

    too many ItemChangedEvent raised by Clicking RadioGroupItem.

    try following code, clicking "yes" radio, ItemChanedEvent fired twice.
    and Window.alert() shows two FormItem object names,
    $5400(i suspect it is garbage) and isc_RadioGroupItem_0.

    Code:
    	DynamicForm dynamicForm = new DynamicForm();
    	dynamicForm.setAutoHeight();
    	dynamicForm.setAutoWidth();
    	final RadioGroupItem radioGroupItem = new RadioGroupItem();
    	LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
    	map.put("0", "yes");
    	map.put("1", "no");
    	radioGroupItem.setValueMap(map);
    	dynamicForm.setFields(new FormItem[] { radioGroupItem } );
    		
    	dynamicForm.addItemChangedHandler(new ItemChangedHandler() {
    		@Override
    		public void onItemChanged(ItemChangedEvent event) {
    			Window.alert(event.getItem().getName());
    		}
    	});
    i'm now using latest version of SmartGWT-2.5(2011-06-05) and GWT-2.3.0.
    IE9 and Chrome 11.0.696.71.
    no javascript error.


    very truly yours.

    #2
    try this :
    Code:
    DynamicForm dynamicForm = new DynamicForm();
    			dynamicForm.setAutoHeight();
    			dynamicForm.setAutoWidth();
    			final RadioGroupItem radioGroupItem = new RadioGroupItem();
    			LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
    			map.put("0", "yes");
    			map.put("1", "no");
    			radioGroupItem.setValueMap(map);
    			dynamicForm.setFields(new FormItem[] { radioGroupItem } );
    				
    			radioGroupItem.addChangedHandler(new ChangedHandler() {				
    				@Override
    				public void onChanged(ChangedEvent event) {
    					SC.say(event.getValue().toString());					
    				}
    			});


    Regards,
    Paata Lominadze

    Comment


      #3
      hi,

      thanks, but you missed point.
      i don't talk about RadioButton's ChangedEvent, but DynamicForm's ItemChangedEvent.

      very truly yours.

      Originally posted by paata
      try this :

      Regards,
      Paata Lominadze

      Comment


        #4
        Thanks for the report, this is fixed and will appear in future nightlies

        Comment

        Working...
        X