removed originating state change in 2.0.3; causing unwanted side effects

This commit is contained in:
Keith Donald
2008-11-14 05:56:18 +00:00
parent e5d8499037
commit ff5006ac05
2 changed files with 9 additions and 43 deletions

View File

@@ -167,28 +167,16 @@ public class ViewState extends TransitionableState {
}
protected void doEnter(RequestControlContext context) throws FlowExecutionException {
ViewState originatingViewState = (ViewState) context.getRequestScope().get("webflow.originatingViewState");
if (this == originatingViewState) {
if (context.getExternalContext().isResponseAllowed()) {
if (context.getExternalContext().isAjaxRequest()) {
View view = viewFactory.getView(context);
render(context, view);
} else {
context.getExternalContext().requestFlowExecutionRedirect();
}
}
} else {
context.assignFlowExecutionKey();
if (context.getExternalContext().isResponseAllowed()) {
if (shouldRedirect(context)) {
context.getExternalContext().requestFlowExecutionRedirect();
if (popup) {
context.getExternalContext().requestRedirectInPopup();
}
} else {
View view = viewFactory.getView(context);
render(context, view);
context.assignFlowExecutionKey();
if (context.getExternalContext().isResponseAllowed()) {
if (shouldRedirect(context)) {
context.getExternalContext().requestFlowExecutionRedirect();
if (popup) {
context.getExternalContext().requestRedirectInPopup();
}
} else {
View view = viewFactory.getView(context);
render(context, view);
}
}
}

View File

@@ -118,28 +118,6 @@ public class ViewStateTests extends TestCase {
assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested());
}
public void testEnterViewStateReturningToSameOriginatingStateNonAjax() {
Flow flow = new Flow("myFlow");
StubViewFactory viewFactory = new StubViewFactory();
ViewState state = new ViewState(flow, "viewState", viewFactory);
MockRequestControlContext context = new MockRequestControlContext(flow);
context.getRequestScope().put("webflow.originatingViewState", state);
state.enter(context);
assertFalse("Render called", context.getFlowScope().contains("renderCalled"));
assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested());
}
public void testEnterViewStateReturningToSameOriginatingStateAjax() {
Flow flow = new Flow("myFlow");
StubViewFactory viewFactory = new StubViewFactory();
ViewState state = new ViewState(flow, "viewState", viewFactory);
MockRequestControlContext context = new MockRequestControlContext(flow);
context.getMockExternalContext().setAjaxRequest(true);
context.getRequestScope().put("webflow.originatingViewState", state);
state.enter(context);
assertTrue("Render called", context.getFlowScope().contains("renderCalled"));
}
public void testResumeViewStateForRefresh() {
Flow flow = new Flow("myFlow");
StubViewFactory viewFactory = new StubViewFactory();