myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (MYFACES-4036) UIData state is not restorable when rowStatePreserved is set to true
Date Wed, 25 May 2016 03:01:13 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-4036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15299370#comment-15299370
] 

Leonardo Uribe commented on MYFACES-4036:
-----------------------------------------

Just to clarify things, _rowStates is a map that holds the information per row when rowStatePreserved
is set to false (default). This variable is "transient" in nature, because it is only used
as long as the cycle is active. _rowStates usually hold the values retrieved from child components
implementing EditableValueHolder interface. On encodeBegin(...), if there are not validation
errors, the values stored there are discarded and fetch again from the data model (it is an
effect related to setRowIndex(...)). After the component is rendered,the values are already
in the html markup, so it is no longer necessary to save that information in the state. On
the next postback request, this map is filled on apply request value phase, but again, it
has a transient nature.

According to the spec, the current behavior of UIData is correct, but on portlet case the
idea is we can apply saveState safely at the end of invoke application phase and restoreState
at the begin of render response phase. It is not as simple as just store the field in the
state, because we don't want to store information in the state that are not required. 

The solution is not easy because we need to handle the case of nested UIData instances.

> UIData state is not restorable when rowStatePreserved is set to true
> --------------------------------------------------------------------
>
>                 Key: MYFACES-4036
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4036
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.2.10-SNAPSHOT
>         Environment: WebSphere Liberty 8.5.5.8, MyFaces 2.2.8, IBM JSF Portlet Bridge
1.0
>            Reporter: Hank Ibell
>            Priority: Minor
>
> A JSF portlet with input fields inside a h:dataTable component will lose their local
values if validation fails, even when rowStatePreserved is set to true.
> The IBM JSF portlet bridge calls processSaveState() on UIViewRoot so that the bridge
can restore the view state on their RENDER request. After looking at UIData, it looks like
_initialDescendantFullComponentState is lost between Portal's ACTION and RENDER requests (a
new UIData object is created on the RENDER request). Unfortunately, UIData's _rowDeltaStates
will not be restored without its initial state.
> It looks like UIData should also save/restore _initialDescendantFullComponentState in
its saveSate()/restoreState() methods since it may be needed to restore _rowDeltaStates.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message