{
Document doc = itsNatDoc.getDocument();
ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();
HTMLInputElement inputElem1 = (HTMLInputElement)doc.getElementById("radioId1");
ItsNatHTMLInputRadio input1 = (ItsNatHTMLInputRadio)componentMgr.findItsNatComponent(inputElem1);
HTMLInputElement inputElem2 = (HTMLInputElement)doc.getElementById("radioId2");
ItsNatHTMLInputRadio input2 = (ItsNatHTMLInputRadio)componentMgr.findItsNatComponent(inputElem2);
HTMLInputElement inputElem3 = (HTMLInputElement)doc.getElementById("radioId3");
ItsNatHTMLInputRadio input3 = (ItsNatHTMLInputRadio)componentMgr.findItsNatComponent(inputElem3);
// Chequeamos que forman ya grupo a trav�s del atributo name
ItsNatButtonGroup itsNatGrp = input1.getItsNatButtonGroup();
ButtonGroup group = itsNatGrp.getButtonGroup();
TestUtil.checkError(input2.getItsNatButtonGroup() == itsNatGrp);
TestUtil.checkError(input3.getItsNatButtonGroup() == itsNatGrp);
TestUtil.checkError(input2.getItsNatButtonGroup().getButtonGroup() == group);
TestUtil.checkError(input3.getItsNatButtonGroup().getButtonGroup() == group);
TestUtil.checkError(input1.getToggleButtonModel().getGroup() == group);
TestUtil.checkError(input2.getToggleButtonModel().getGroup() == group);
TestUtil.checkError(input3.getToggleButtonModel().getGroup() == group);
ToggleButtonModel dataModel1 = new ToggleButtonModel();
input1.setButtonModel(dataModel1);
ToggleButtonModel dataModel2 = new ToggleButtonModel();
input2.setButtonModel(dataModel2);
ToggleButtonModel dataModel3 = new ToggleButtonModel();
input3.setButtonModel(dataModel3);
group = new ButtonGroup();
ItsNatButtonGroup htmlGroup = componentMgr.getItsNatButtonGroup(group);
htmlGroup.addButton(input1);
htmlGroup.addButton(input2);
htmlGroup.addButton(input3);
TestUtil.checkError(htmlGroup == componentMgr.getItsNatButtonGroup(group));
TestUtil.checkError(htmlGroup == componentMgr.getItsNatButtonGroup(htmlGroup.getName()));
TestUtil.checkError(input1.getItsNatButtonGroup().getButtonCount() == 3);
TestHTMLInputRadio listener1 = new TestHTMLInputRadio("1",itsNatDoc);
input1.addEventListener("click",listener1);
dataModel1.addChangeListener(listener1);
TestHTMLInputRadio listener2 = new TestHTMLInputRadio("2",itsNatDoc);
input2.addEventListener("click",listener2);
dataModel2.addChangeListener(listener2);
TestHTMLInputRadio listener3 = new TestHTMLInputRadio("3",itsNatDoc);
input3.addEventListener("click",listener3);
dataModel3.addChangeListener(listener3);
}