Avatar

Level 2

So we've got a set of Rows, each with a subitem called RadioToggle, and you want to go through and set them all, then click a separate button and hide the ones with "on" radio buttons?

function ToggleRows(reset){

     var Rows = Form.subform....BugGroup_f.all;

     var curRow;

     for (var i=0; i<Rows.length; i++){

          curRow = Rows.item(i);

          if ((curRow.RadioButton.rawValue == "WhatevermeansHidden") && !reset){

               curRow.presense = "hidden";}

          else{

               curRow.presense = "visible";}

     }

}

^ in a script object, and put

scriptObjectName.ToggleRows(reset);

in the click event of your button, and you should be golden.

If you do want them to hide the moment you click the toggle, you could put this, right?

if (xfa.event.newText == "whatevermeansoff"){

     parent....presense = "hidden";}

The .all method seems like a much easier way to handle collections of objects, and specificaly collections of instances. It also means you can do relative referencing, i.e. to create a function that will operate on all the rows of a table, without knowing which table it is operating on, so a button in each table can pass it's parent table to the function.

var GroupVariable = Object.all

for(var i=0; i < GroupVariable.length; i++)

EDIT:

add a reset value, and pass it in to your function like above (added).

make a separate button, or control, that will call the function with reset = 1.