From an action in a view that is made of multiple borders, splits, and so on, I would like to reach data that are situated in different tables of the view.
To do that, I try to deduce the viewPath parameter for the getSelectedModel, getModel methods.
What is the structure of the view, how to navigate between the different tables and deduce the viewPath in order to call the getSelectedModel / getModel... ?
The view path is an array of indexes that allows to navigate from a view to another one in the containment hierarchy. It is used in several methods of the
AbstractActionContextAwareclass that is extended by all actions, but that you can also extend from any application class that would need utility methods to explore the action context.The rationale behind this view path is to start from the view from which the action was triggered and to follow the view path to reach the target view and, for instance, get its selected index.
The navigation rules are the following :
The index of the child view when a positive step is found depends on the type of container you're on. Here are the rules :
For instance, given the following UI :
the view path from table
`A`to table`B`will be :[-1, -1, 1, 1]