Your example has a check box that is the next sibling of a button box, which means it is really easy for the button box to find the checkbox, if only the button box can find itself. It can, if you use setFunction rather than set script. Bold text, below. The variable is gone. You now have an anonymous function (not assigned to a JSL variable) that the button box can pass "this" to. "this" is the button box, and the sibling of "this" is the checkbox. The PF variable is still changed, but I'm not sure you need it. It is possible for the function to crawl up through the <<parent chain to find the platform that holds the button.
Table 1 = New Table( "Table 1",
Add Rows( 1 ),
New Column( "p1", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [2] ) ),
New Column( "p2", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [3] ) ),
New Column( "model",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( :p1 ^ 2 + :p2 ^ 2 ),
Set Selected
),
Set Row States( [1] )
);
PF = Profiler(
Y( :model ),
Profiler(
1,
Term Value(
p1( 2, Min( 1.9 ), Max( 2.1 ), Lock( 0 ), Show( 1 ) ),
p2( 3, Min( 2.9 ), Max( 3.1 ), Lock( 0 ), Show( 1 ) )
)
)
);
Report( PF )["Prediction Profiler"] << Append(
Button Box( "Turn On" );
//NewIndicator = Radio Box();
);
Report( PF )["Prediction Profiler"] << Append( Check Box( "Item 1" ) );
Report( PF )[Button Box( 1 )] << Set Function( Function( {this}, (this << sib) << Set( 1 ) ) );
Craige