cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
David_Burnham
Super User (Alumni)

Unexpected Events from Local Data Filter Change Handler

Below is some illustrative code that displays a graph with a local data filter.

 

namesDefaultToHere(1);

dt = open("$SAMPLE_DATA/Big Class.jmp");

graphContent = VListBox(
	dt << Bivariate( 
		Y(:weight), 
		X(:height) 
	)	
);

NewWindow("Test",
	Data Filter Context Box(
		BorderBox(top(20),bottom(20),left(20),right(20),
			HListBox(
			
				// local data filter
				::df = dt << Data Filter( local,
					AddFilter(
						columns(:sex),
						display(:sex,"List Display")
					)
				),

				// some content
				graphContent	
							
			)
		)
	)
);

// define event handler for data filter

::rs = ::df << makeFilterChangeHandler(
	function({x},
		show("data filter event handler");	
		show(hptime());	
	)
);

 

Making selections to the data filter triggers the event handler, as expected.

 

However, the event handler also gets triggered just by hovering over data points in the graph.  Does anyone have any thoughts on why that would happen?

-Dave
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Unexpected Events from Local Data Filter Change Handler

One way that you can distinguish these messages is by testing for x==(-1).  This message should probably be omitted for the df<<makeFilterChangeHandler().  It has more meaning for box<<makeRowStateHandler(), which has to handle the case when filters are added or removed.

View solution in original post

1 REPLY 1

Re: Unexpected Events from Local Data Filter Change Handler

One way that you can distinguish these messages is by testing for x==(-1).  This message should probably be omitted for the df<<makeFilterChangeHandler().  It has more meaning for box<<makeRowStateHandler(), which has to handle the case when filters are added or removed.