Tabnine Logo
ViewState.addVariable
Code IndexAdd Tabnine to your IDE (free)

How to use
addVariable
method
in
org.springframework.webflow.engine.ViewState

Best Java code snippets using org.springframework.webflow.engine.ViewState.addVariable (Showing top 6 results out of 315)

origin: org.springframework.webflow/spring-webflow

/**
 * Adds a set of view variables.
 * @param variables the variables
 */
public void addVariables(ViewVariable... variables) {
  for (ViewVariable variable : variables) {
    addVariable(variable);
  }
}
origin: spring-projects/spring-webflow

/**
 * Adds a set of view variables.
 * @param variables the variables
 */
public void addVariables(ViewVariable... variables) {
  for (ViewVariable variable : variables) {
    addVariable(variable);
  }
}
origin: org.springframework.webflow/org.springframework.webflow

/**
 * Adds a set of view variables.
 * @param variables the variables
 */
public void addVariables(ViewVariable[] variables) {
  for (int i = 0; i < variables.length; i++) {
    addVariable(variables[i]);
  }
}
origin: spring-projects/spring-webflow

public void testResumeViewStateRestoreVariables() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  state.addVariable(new ViewVariable("foo", new VariableValueFactory() {
    public Object createInitialValue(RequestContext context) {
      return new TestBean();
    }
    public void restoreReferences(Object value, RequestContext context) {
      ((TestBean) value).datum1 = "Restored";
    }
  }));
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  state.resume(context);
  assertTrue("Render not called", context.getFlowScope().contains("renderCalled"));
  assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested());
  assertEquals("Restored", ((TestBean) context.getViewScope().get("foo")).datum1);
}
origin: spring-projects/spring-webflow

public void testEnterViewStateWithVariables() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  state.addVariable(new ViewVariable("foo", new VariableValueFactory() {
    public Object createInitialValue(RequestContext context) {
      return "bar";
    }
    public void restoreReferences(Object value, RequestContext context) {
    }
  }));
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  assertEquals("bar", context.getViewScope().getString("foo"));
  assertTrue("Render not called", context.getFlowScope().contains("renderCalled"));
  assertTrue(context.getExternalContext().isResponseComplete());
  assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested());
}
origin: spring-projects/spring-webflow

public void testResumeViewStateForEventDestroyVariables() {
  Flow flow = new Flow("myFlow");
  StubViewFactory viewFactory = new StubViewFactory();
  ViewState state = new ViewState(flow, "viewState", viewFactory);
  state.addVariable(new ViewVariable("foo", new VariableValueFactory() {
    public Object createInitialValue(RequestContext context) {
      return "bar";
    }
    public void restoreReferences(Object value, RequestContext context) {
    }
  }));
  state.getTransitionSet().add(new Transition(on("submit"), to("next")));
  new ViewState(flow, "next", viewFactory);
  MockRequestControlContext context = new MockRequestControlContext(flow);
  state.enter(context);
  assertTrue(context.getViewScope().contains("foo"));
  context = new MockRequestControlContext(context.getFlowExecutionContext());
  context.putRequestParameter("_eventId", "submit");
  state.resume(context);
  assertTrue(context.getFlowExecutionContext().isActive());
  assertEquals("next", context.getCurrentState().getId());
  assertFalse(context.getViewScope().contains("foo"));
}
org.springframework.webflow.engineViewStateaddVariable

Javadoc

Adds a view variable.

Popular methods of ViewState

  • <init>
    Create a new view state.
  • getId
  • getRenderActionList
    Returns the list of actions executable by this view state on entry and on refresh. The returned list
  • getViewFactory
    Returns the view factory.
  • resume
  • setPopup
    Sets whether this view state should render as a popup.
  • setRedirect
    Sets whether this view state should requests a flow execution redirect when entered.
  • addVariables
    Adds a set of view variables.
  • createVariables
  • destroyVariables
  • getEntryActionList
  • getOwner
  • getEntryActionList,
  • getOwner,
  • refresh,
  • render,
  • restoreVariables,
  • shouldRedirect,
  • updateHistory,
  • clearFlash,
  • getRedirect

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now