Enable disable of tabs

Hi i have an issue where i have a radiobutton group with two options whose values are Yes and No

Also i have a toggle tabs control with two options as Tab1 and Tab2,Tab2 is initially disabled by setting the itemDisabled property of that option to true.

i want that when i click Yes option of radiobutton group,the Tab2 should be enabled.

I have written following javascript code in the click event of radiobutton group:

if(enableDisableTab(“#{activePageBean.clientIds[‘htmlSelectOneRadio1’]}”))
{
CAF.model(‘#{activePageBean.clientIds[‘selectItem5’]}’).setDisabled(false);
}

else
{
CAF.model(‘#{activePageBean.clientIds[‘selectItem5’]}’).setDisabled(false);
}

function enableDisableTab(controlId)
{
var controlValue;
controlValue = CAF.model(controlId).getValue();
if(controlValue==‘sunny’)
{
return true;
}
else
{
return false;
}
}

I am getting following error in javascript:
CAF.model(“jsfwmp10189:defaultForm:selectItem5”) is null

Please help

Usually means that you are at the object level and need to go down a level… maybe something like

var selValue = CAF.model(controlId).selected()[0].getValue();

Hi,It is giving the error that

Error: CAF.model(“jsfwmp10533:defaultForm:toggleTabs”).selected()[0] is undefined
Source File:

I will generalise my question. If we have a group control and inside it many options…then how can we access those options?
For eg if i have a radiobutton group with 3 options then how to disable option2?