view scope
This commit is contained in:
@@ -97,4 +97,8 @@ public class SerializableListDataModel extends DataModel implements Serializable
|
||||
setRowIndex(newRowIndex);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return data.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class FlowViewStateManager extends StateManager {
|
||||
}
|
||||
|
||||
RequestContext requestContext = RequestContextHolder.getRequestContext();
|
||||
SerializedView view = (SerializedView) requestContext.getFlowScope().get(SERIALIZED_VIEW_STATE);
|
||||
SerializedView view = (SerializedView) requestContext.getViewScope().get(SERIALIZED_VIEW_STATE);
|
||||
viewRoot.processRestoreState(context, view.componentState);
|
||||
logger.debug("UIViewRoot component state restored");
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class FlowViewStateManager extends StateManager {
|
||||
}
|
||||
|
||||
RequestContext requestContext = RequestContextHolder.getRequestContext();
|
||||
SerializedView view = (SerializedView) requestContext.getFlowScope().get(SERIALIZED_VIEW_STATE);
|
||||
SerializedView view = (SerializedView) requestContext.getViewScope().get(SERIALIZED_VIEW_STATE);
|
||||
if (view == null || !view.viewId.equals(viewId)) {
|
||||
logger.debug("No matching view in flow scope;");
|
||||
return null;
|
||||
@@ -145,7 +145,7 @@ public class FlowViewStateManager extends StateManager {
|
||||
}
|
||||
SerializedView view = new SerializedView(context.getViewRoot().getViewId(), getTreeStructureToSave(context),
|
||||
getComponentStateToSave(context));
|
||||
requestContext.getFlowScope().put(SERIALIZED_VIEW_STATE, view);
|
||||
requestContext.getViewScope().put(SERIALIZED_VIEW_STATE, view);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@@ -228,6 +228,10 @@ public class JsfViewFactoryTests extends TestCase {
|
||||
|
||||
private class NormalViewState implements StateDefinition {
|
||||
|
||||
public boolean isViewState() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
throw new UnsupportedOperationException("Auto-generated method stub");
|
||||
}
|
||||
|
||||
@@ -265,6 +265,10 @@ public class JsfViewTests extends TestCase {
|
||||
|
||||
MutableAttributeMap attrs = new LocalAttributeMap();
|
||||
|
||||
public boolean isViewState() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public ModalViewState() {
|
||||
attrs.asMap().put("modal", Boolean.TRUE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user