Highlighted

How to get a group of radio button name?

Avatar

Avatar

ChromeUser

Avatar

ChromeUser

ChromeUser

04-12-2008

I have read the LiveCycle Designer Scriping Reference and test a example in it.

for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {

var oFields = xfa.layout.pageContent(nPageCount, "field");

var nNodesLength = oFields.length;

// Set the field property.

for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {

oFields.item(nNodeCount).access = "readOnly";

var nodeName = oFields,item(nNodeCount).name;

}

}



I found that it can not get the name of the group of radio button(the group is exclGroup , i think) by this method, I also tried "pageContent(nPageCount, "pageArea")" and other, may be i use the wrong method to get the group name.



I want to find the group object and compare the group name with predefined string so that to decide whether to change the group object value.



Anyone can help me?

Thanks,

Jasper

Replies

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

04-12-2008

For each field that you get back you need to check and see what type of object it is. If you check the classname it will indicate what type it is. Here is some code I use to check if it is a radiobutton or not.



//Check for exclusion groups - Radio Buttons

else if(currentElement.className == "exclGroup"){

for(k=0; k< currentElement.nodes.length;k++){

if(currentElement.nodes.item(k).className == "field"){

//set the color for the radio buttons individually

currentElement.nodes.item(k).ui.checkButton.border.fill.color.value = defaultcolor;

}

Avatar

Avatar

ChromeUser

Avatar

ChromeUser

ChromeUser

10-12-2008

Thanks,Paul.

I have fixed it.