view scope

This commit is contained in:
Keith Donald
2008-03-29 06:10:01 +00:00
parent 794b7345a9
commit bc2ed3e868
20 changed files with 166 additions and 31 deletions

View File

@@ -97,4 +97,8 @@ public class SerializableListDataModel extends DataModel implements Serializable
setRowIndex(newRowIndex);
}
public String toString() {
return data.toString();
}
}

View File

@@ -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;
}

View File

@@ -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");
}

View File

@@ -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);
}