removed originating state change in 2.0.3; causing unwanted side effects
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user