Package org.springframework.webflow.engine.builder

Examples of org.springframework.webflow.engine.builder.BinderConfiguration.addBinding()


    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = new MockView();
    AbstractMvcView view = new MockMvcView(mvcView, context);
    view.setExpressionParser(DefaultExpressionParserFactory.getExpressionParser());
    BinderConfiguration binderConfiguration = new BinderConfiguration();
    binderConfiguration.addBinding(new Binding("stringProperty", null, true));
    view.setBinderConfiguration(binderConfiguration);
    view.processUserEvent();
    assertTrue(view.hasFlowEvent());
    assertEquals("submit", view.getFlowEvent().getId());
    assertEquals("foo", bindBean.getStringProperty());
View Full Code Here


              .booleanValue();
        } else {
          required = false;
        }
        Binding binding = new Binding(bindingModel.getProperty(), bindingModel.getConverter(), required);
        binderConfiguration.addBinding(binding);
      }
      return binderConfiguration;
    } else {
      return null;
    }
View Full Code Here

    context.getMockFlowExecutionContext().setKey(new MockFlowExecutionKey("c1v1"));
    org.springframework.web.servlet.View mvcView = new MockView();
    AbstractMvcView view = new MockMvcView(mvcView, context);
    view.setExpressionParser(createExpressionParser());
    BinderConfiguration binderConfiguration = new BinderConfiguration();
    binderConfiguration.addBinding(new Binding("stringProperty", null, true));
    view.setBinderConfiguration(binderConfiguration);
    view.processUserEvent();
    assertTrue(view.hasFlowEvent());
    assertEquals("submit", view.getFlowEvent().getId());
    assertEquals("foo", bindBean.getStringProperty());
View Full Code Here

    StringToDate stringToDate = new StringToDate();
    stringToDate.setPattern("MM-dd-yyyy");
    conversionService.addConverter("customDateConverter", stringToDate);
    view.setConversionService(conversionService);
    BinderConfiguration binderConfiguration = new BinderConfiguration();
    binderConfiguration.addBinding(new Binding("dateProperty", "customDateConverter", true));
    view.setBinderConfiguration(binderConfiguration);
    view.processUserEvent();
    assertTrue(view.hasFlowEvent());
    assertEquals("submit", view.getFlowEvent().getId());
    Calendar cal = Calendar.getInstance();
View Full Code Here

      protected String toString(Object object) throws Exception {
        return "$" + object;
      }
    });
    BinderConfiguration binder = new BinderConfiguration();
    binder.addBinding(new Binding("datum2", "customConverter", true));
    model.setBinderConfiguration(binder);
    assertEquals("$3", model.getFieldValue("datum2"));
  }

  public void testGetFieldValueError() {
View Full Code Here

        boolean required = false;
        if (StringUtils.hasText(bindingModel.getRequired())) {
          required = ((Boolean) fromStringTo(Boolean.class).execute(bindingModel.getRequired()));
        }
        Binding binding = new Binding(bindingModel.getProperty(), bindingModel.getConverter(), required);
        binderConfiguration.addBinding(binding);
      }
      return binderConfiguration;
    } else {
      return null;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.