Open eclipse-faces-bot opened 13 years ago
@glassfishrobot Commented Reported by dueni
@glassfishrobot Commented darious3 said: Would this also help the much needed CDI implementation of @ViewScoped?
@glassfishrobot Commented dueni said: Could be, if CDI needs to support @ViewScoped, there must be a way to hook into view-scope state saving and restoring. By explicitly define when and how ViewScope state is saved and restored this would also allow other DI frameworks to provide the @ViewScoped beans. But then I think this will be a spec change and I guess it will not make it into 2.2.
@glassfishrobot Commented @edburns said: You are right that we need to de-couple the implementation of @ViewScoped on top of CDI from code in UIViewRoot. More API needs to be done.
@glassfishrobot Commented @edburns said: Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
@glassfishrobot Commented Parent-Task: JAVASERVERFACES_SPEC_PUBLIC-787
@glassfishrobot Commented Issue-Links: blocks JAVASERVERFACES_SPEC_PUBLIC-1087 is related to JAVASERVERFACES_SPEC_PUBLIC-787
@glassfishrobot Commented This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-1034
With #787 a new method restoreViewScopeState was added to UIViewRoot to allow restore ViewScope before buildView is called. But there is no matching saveViewScopeState method.
This issue proposes adding also a method saveViewScopeState() method to UIViewRoot and save the ViewScope state no longer as part of UIViewRoot's state array but rather as an element of the rawState Object[]. Looking at StateManagementStrategyImpl.saveView() - that always returns new Object[]
{ null, stateMap }
; I see element[0] is used to store component structure (full state saving only?). So an additional third element could keep the ViewScope state built from saveViewscopeState() - and restoreState would use thrid rawState element as argument to restoreViewScopeState().
That would allow more flexibility e.g if some impl. or adapter/bridge needs to handle ViewScope state differently. By wrapping UIViewRoot and overriding save-/restoreViewScopeState() methods that would be possible. Currently ViewScope state is bound to UIViewRoot state structure.
Affected Versions
[2.2]