Login Register

selected

How do change the selected tab to another tab in code?

I have been trying unsuccessfully to change the selected tab to another tab. Here is the scenario:
User has a page with a button on it followed by a tab container with 4 tabs. Tab number 4 is selected.
When user clicks on the button, I want tab number 1 to be selected.
This part works, in that it changes the selected value to tab number 1, but nothing happens in the browser to reflect the change:

var myTab4 = dojo.byId('tab4');
    myTab4.setAttribute('selected','false');
    var myTab1 = dojo.byId('tab1');
    myTab1.setAttribute('selected','true');

radiobutton: get selected value

After hours of searching a way to submit only the value of an radiobutton group, i find myself searching in the api. as far as i see, there is no simple way to access the checked (selected) value. So i just hacked into the Checkbox.js following code:

getCheckedValue: function(){
			// HACK
			var res = false;
			dojo.forEach(this._groups[this.name], function(widget){
				if(widget.checked) res = widget.value;
			}, this);	
			return res;
		},

It works so far. Maybe its a nice extension for the next release...
You can call it by:

Syndicate content