[JAVASERVERFACES_SPEC_PUBLIC-1021] Expose component local values in single key/value data structure Created: 23/Jun/11 Updated: 01/Aug/14
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
Every ValueHolder JSF component has a local value. It would be nice to have access to these local values knowing only the name of component. Something like this. We could specify that the viewMap must be populated with references to the ValueHolder instances in the current view. Then, you could say:
ValueHolder comp = (ValueHolder) context.getViewMap().get("<your componentId>");
Look at the API for ValueHolder.
|Comment by Jakob Korherr [ 23/Jun/11 ]|
Nice idea. This would make the binding attribute kinda obsolete, right?
|Comment by arjan tijms [ 05/Jul/11 ]|
Just wondering, will this view map only contain ValueHolder instances or also other components? In case it also contains other components, it's perhaps a bit similar to:
Well, with the binding attribute a backing bean receives an instance of a component without having to know its ID at all. This is handy since within a backing bean there might be situations where you can't know this ID and/or do not want to know it. So the binding attribute doesn't seem to be made obsolete if I understand the proposal correctly.
|Comment by Hanspeter Duennenberger [ 07/Jul/11 ]|
Why should that be on ViewMap? That would mean the ViewMap has to be cleared of these component references before state is saved.
|Comment by Ed Burns [ 07/Jul/11 ]|
HD> Why should that be on ViewMap? That would mean the ViewMap has to be
Good point. It should really be on the FacesContext attributes Map.
Here is more from the reporter.
>>>>> On Wed, 6 Jul 2011 10:53:46 +0200, Rainer Sinkwitz said:
RS> Hi Mr. Burns,
RS> For your information here is what I do right now: I make the UIComponent
RS> So if I have that map in the session, then I can use an EL expressions
RS> ... and viewMap[...].value gives me the converted object since there is
RS> Lets me again describe by basic setting: Most of our forms have a "View"
RS> So far so good, but the complication begins when I do AJAX updates with
RS> An alternative solution would be to let the form work against a copy of
RS> Anyway, thanks for your response, with best regards, Rainer
|Comment by Hanspeter Duennenberger [ 08/Jul/11 ]|
EB> Good point. It should really be on the FacesContext attributes Map.
And even in FacesContext it needs to be cleared whenever ViewRoot changes. That remembers me to something we discussed some time back - a View-related-Request scope. That is something that lifes during a request but only as long as the ViewRoot does not change. I guess that could easily be handled on FacesContext and that would be the place for such things as the references to EditableValueHolders.
|Comment by Ed Burns [ 01/Aug/14 ]|
Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
|Comment by Manfred Riem [ 01/Aug/14 ]|
Setting priority to Minor