Hi @danschikore, thank you for the reply.
I noticed that a Data Filter which is opened from a Graph Builder object always triggers the function twice - while a Data filter in a Data Filter Context Box just triggers the function 1x.
And if you disable the
count excluded rows
of the "inner" Data Filter then you can watch some ping-pong between both data filters.
What is the reason for the function calls with return value 0?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
countexcluded = 1;
New Window( "Big Class - Dashboard",
Data Filter Context Box(
Panel Box( "Data Filter Context Box: Data Filter + GraphBuilder",
H Splitter Box(
Size( 700, 400 ),
<<Sizes( {0.3, 0.7} ),
dt << Data Filter( Local, Add Filter( columns( :sex ) ) ),
Panel Box( "Graph builder + local data fitler",
V List Box(
Button Box( "toggle count excluded",
countexcluded = Not( countexcluded );
(Current Report()[Panel Box( 2 )]["Local Data Filter"] << get scriptable object()) <<
count excluded rows( countexcluded );
),
gb = dt << Graph Builder(
Size( 211, 211 ),
Show Control Panel( 0 ),
Fit to Window,
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Local Data Filter( Add Filter( columns( :age ) ) )
)
)
)
)
)
)
);
dfs = (Current Report() << XPath( "//OutlineBox[text()='Local Data Filter']" )) << get scriptable object();
f1 = Function( {a}, write("outer: ", a,"\!n" ) );
f2 = Function( {a}, write("inner: ", a,"\!n" ) );
rs1 = dfs[1] << Make Filter Change Handler( f1 );
rs2 = dfs[2] << Make Filter Change Handler( f2 );