Filter Changed event

This event occurs in two different scenarios:

  • When the page containing the layout is loaded and the layout is about to fetch data. If the layout is at the page level, it is not embedded inside of any other layout, the filter received comes from the URL. If the URL does not contain a filter, the event still occurs with an empty filter.
  • When the layout has received a new filter and is about to fetch or re-fetch its data.

The new filter criteria are available in the parms. If the portal developer wants to load the data manually, for example via a custom load method, this is where that would be done.

These filter change APIs should exist on both the server and client:

context.Handlers.RegisterFilterChangedHandler(OnFilterChanged)

context.Handlers.UnregisterFilterChangedHandler()

The client-side alert handler is called first, followed by the server-side handler. This is true even when the alert was sent from server scripting. There is an exception to this case for AlertComponentFilterChanged(). See AlertComponentFilterChanged.

If there is no work that needs to be done on the server side, the following call should be made in the client-side handler to prevent passing the filter to the server side, as this avoids unneeded round trips from client to server.

parms.SetIsLoaded(true)