I am working on documenting how to do a Master/detail relationship. I have gone through the source code and found the two keep commands I need to work with:
updateActionListener
saveState
I found these in the src code and after reviewing them, it appears their behavior is:
updateActionListener; A property is defined for a target class and is assigned a value. The method uses ValueBinding to detemine the root class. The values from the source object are passed (converted) to the target object and the target object is saved to the FacesContext.
saveState; populates the curent Managed bean from the one stored in the updateActionListener command.
Is this correct? Is there more to it then that?
1. updateActionListener
Purpose is to set a bean property to a certain value when an action is fired. As you guessed, this enables a master page to easily set the necessary attributes for a detail page. Common use case is to use the primary key of the current row in the master list as value and set the primary key in the detail model bean.
2. saveState
The <x:saveState> tag is generally useful if you are using client-side state saving. In client-side state saving all the model beans would lose their values on every request. With the convenient <x:saveState> tag it is possible to save the bean (which must therefore be Serializable of course) together with the component states in the client state, so that it gets a similiar behaviour as a server-side bean, that is saved in the servlet session. Even better: the bean will never loose the state that it had during a certain response. Using browser back, the bean will always have the same state, again and again. You know, browser back with server-side beans is always a big problem, because you might get requests for a historic page while the corresponding bean is already in a completely different state.
HTH, Manfred

