Filter Change HandlerI just found out: Make Filter Change handler only works if I store the return value in a variable.
Why does
filter << Make Filter Change Handler( f );
not work? Is there some knowledge behind it that is worth knowing?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
dist = Distribution( Automatic Recalc( 1 ), Continuous Distribution( Column( :POP ) ) );
filter = dist << Local Data Filter( Add Filter( columns( :Region ) ) );
f = Function( {a}, Print( a ) );
// 1st version dosn't work - why?
// filter << Make Filter Change Handler( f );
rs = filter << Make Filter Change Handler( f );Automation and ScriptingRe: Filter Change HandlerHi @hogi - this just came up with someone else recently. The reason behind the current behavior is that the JSL symbol is the owner of the object that dispatches the callbacks. Unlike platforms that create a window, there is not another clear candidate to take ownership. This also happens with things like display boxes if you create a box but do not give it a parent or store it to a symbol, it's just less noticeable in that case. One option would be to put the variable into a window-scope symbol so that it will go away with the report.
Re: Filter Change HandlerHi @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></SIZES>