/**
 * @author Michael Bannach
 * @version 0.1
 * 
 * Own radiogroup implementation based on the ext 2.2 radiogroup
 */
Ext.namespace('Ext.ux');
Ext.ux.RadioGroup = Ext.extend(Ext.form.RadioGroup,  {

	// private
    initComponent : function(){
        Ext.ux.RadioGroup.superclass.initComponent.call(this);
        this.addEvents(
            /**
             * @event change
             * Fires when the radio value changes.
             * @param {Ext.vx.RadioGroup} this This radio
             * @param {Boolean} checked The new checked value
             */
            'check'
        );
    },

	getValue: function() {
	    var v;
	
	    this.items.each(function(item) {
	      v = item.getRawValue();
	      return !item.getValue();
	    });
	
		return v;
	},

  	setValue: function(v) {
    	this.items.each(function(item) {
      		item.setValue(item.getRawValue() == v);
    	});
  	}

});
Ext.reg('ux-radiogroup', Ext.ux.RadioGroup);
