Managing component value state correctly
By Frank Nimphius-Oracle on May 08, 2012
A frequent problem reported on OTN is about failure in
saving component values using managed beans especially when multi-select components are used.
Usually the problem arises when developers store select choice components values in managed beans they use for JSF component bindings as well (which then makes the managed bean becoming a backing bean). Backing beans however are saved in request scope (at least they should to not err again).
I was about to write this solution up in more detail but then found the following blog entry by Duncan Mills:
In his The UIManager Pattern blog entry, Duncan documented the same problem from a different angle. The programmer mistake Duncan observed was that component binding references (the Bindings property reference on an ADF Faces component) were stored in managed beans with a scope larger than request, which JavaServer Faces component don't support.
In his write-up Duncan documents the same strategy I was about to document, which is to separate the value saving from the component reference using different managed beans in different scope. Well, I think that Duncan's blog entry saved me some time I today.