jakartaee / faces

Jakarta Faces
Other
108 stars 55 forks source link

disentangle ViewScope state handling from UIViewRoot.saveState()/restoreState() methods to better control ViewScope state handling #1034

Open eclipse-faces-bot opened 13 years ago

eclipse-faces-bot commented 13 years ago

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]

eclipse-faces-bot commented 5 years ago
eclipse-faces-bot commented 13 years ago

@glassfishrobot Commented Reported by dueni

eclipse-faces-bot commented 12 years ago

@glassfishrobot Commented darious3 said: Would this also help the much needed CDI implementation of @ViewScoped?

eclipse-faces-bot commented 12 years ago

@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.

eclipse-faces-bot commented 12 years ago

@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.

eclipse-faces-bot commented 10 years ago

@glassfishrobot Commented @edburns said: Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

eclipse-faces-bot commented 13 years ago

@glassfishrobot Commented Parent-Task: JAVASERVERFACES_SPEC_PUBLIC-787

eclipse-faces-bot commented 13 years ago

@glassfishrobot Commented Issue-Links: blocks JAVASERVERFACES_SPEC_PUBLIC-1087 is related to JAVASERVERFACES_SPEC_PUBLIC-787

eclipse-faces-bot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-1034