Scenario:
It is necessary to execute server-side code that requires refreshing the current View as a response to user actions in an ASP.NET application. For example, show the first navigation item when a new navigation group is selected.
Steps to Implement:
1. Create a Controller that implements the IXafCallbackHandler interface. This interface allows defining server-side code that is executed when an XAF callback is raised.
2. Place the required server-side code to the IXafCallbackHandler.ProcessAction method, e.g. change ShowNavigationItemAction's selected item.
3. Subscribe to the Window.ProcessActionContainer event to access a navigation control (NavigationTabsActionContainer).
4. Raise an XAF callback by passing javascript generated by the XafCallbackManager.GetScript method to the NavigationTabsActionContainer.PageControl.ClientSideEvents.ActiveTabChanged event handler.
5. Register your callback handler (Controller) using the XafCallbackManager.RegisterHandler method.
See also:
How to implement the drill-down functionality in Web PivotGrid (ASPxPivotGrid)
↧
How to raise XAF callbacks from client-side events and process them on the server?
↧