binder config; update to 2.5.5
This commit is contained in:
@@ -23,9 +23,9 @@
|
||||
<dependency org="javax.el" name="com.springsource.javax.el" rev="2.1.0" conf="provided->compile"/>
|
||||
<dependency org="org.apache.commons" name="com.springsource.org.apache.commons.logging" rev="1.1.1" conf="compile->compile"/>
|
||||
<dependency org="org.ognl" name="com.springsource.org.ognl" rev="2.7.3" conf="optional->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.5.A" conf="compile->compile"/>
|
||||
|
||||
<!-- test-time only dependencies -->
|
||||
<dependency org="org.apache.log4j" name="com.springsource.org.apache.log4j" rev="1.2.15" conf="test->compile"/>
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
<dependency org="javax.servlet" name="com.springsource.javax.servlet" rev="2.4.0" conf="provided->compile" />
|
||||
<dependency org="org.apache.commons" name="com.springsource.org.apache.commons.logging" rev="1.1.1" conf="compile->compile"/>
|
||||
<dependency org="org.richfaces" name="com.springsource.org.richfaces" rev="3.1.4.GA" conf="optional->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework.webflow" name="org.springframework.binding" rev="latest.integration" conf="compile->compile"/>
|
||||
<dependency org="org.springframework.webflow" name="org.springframework.js" rev="latest.integration" conf="compile->compile"/>
|
||||
<dependency org="org.springframework.webflow" name="org.springframework.webflow" rev="latest.integration" conf="compile->compile"/>
|
||||
@@ -50,7 +50,7 @@
|
||||
<dependency org="org.easymock" name="com.springsource.org.easymock" rev="2.3.0" conf="test->compile" />
|
||||
<dependency org="org.junit" name="com.springsource.junit" rev="3.8.2" conf="test->compile" />
|
||||
<dependency org="org.jboss.el" name="com.springsource.org.jboss.el" rev="2.0.0.GA" conf="test->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.test" rev="2.5.4.A" conf="test->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.test" rev="2.5.5.A" conf="test->compile" />
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -25,17 +25,17 @@
|
||||
<dependency org="org.apache.tiles" name="com.springsource.org.apache.tiles" rev="2.0.5" conf="optional->compile"/>
|
||||
<dependency org="org.apache.tiles" name="com.springsource.org.apache.tiles.core" rev="2.0.5.osgi" conf="optional->compile"/>
|
||||
<dependency org="org.apache.tiles" name="com.springsource.org.apache.tiles.jsp" rev="2.0.5" conf="optional->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="2.5.5.A" conf="compile->compile"/>
|
||||
|
||||
<!-- test time only dependencies -->
|
||||
<dependency org="org.apache.log4j" name="com.springsource.org.apache.log4j" rev="1.2.15" conf="test->compile"/>
|
||||
<dependency org="org.easymock" name="com.springsource.org.easymock" rev="2.3.0" conf="test->compile" />
|
||||
<dependency org="org.junit" name="com.springsource.junit" rev="3.8.2" conf="test->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.test" rev="2.5.4.A" conf="test->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.test" rev="2.5.5.A" conf="test->compile" />
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -33,15 +33,15 @@
|
||||
<dependency org="org.hibernate" name="com.springsource.org.hibernate.ejb" rev="3.3.1.ga" conf="compile->compile"/>
|
||||
<dependency org="org.hsqldb" name="com.springsource.org.hsqldb" rev="1.8.0.9" conf="compile->compile"/>
|
||||
<dependency org="org.jboss.el" name="com.springsource.org.jboss.el" rev="2.0.0.GA" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.aop" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.jdbc" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.orm" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.transaction" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.aop" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.jdbc" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.orm" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.transaction" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework.security" name="org.springframework.security" rev="2.0.2.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework.webflow" name="org.springframework.faces" rev="latest.integration" conf="compile->jsf12"/>
|
||||
<dependency org="org.springframework.webflow" name="org.springframework.js" rev="latest.integration" conf="compile->compile"/>
|
||||
@@ -50,7 +50,7 @@
|
||||
<!-- test-time only dependencies -->
|
||||
<dependency org="org.easymock" name="com.springsource.org.easymock" rev="2.3.0" conf="test->compile" />
|
||||
<dependency org="org.junit" name="com.springsource.junit" rev="3.8.2" conf="test->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.test" rev="2.5.4.A" conf="test->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.test" rev="2.5.5.A" conf="test->compile"/>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -36,16 +36,16 @@
|
||||
<dependency org="org.hibernate" name="com.springsource.org.hibernate.ejb" rev="3.3.1.ga" conf="compile->compile"/>
|
||||
<dependency org="org.hsqldb" name="com.springsource.org.hsqldb" rev="1.8.0.9" conf="compile->compile"/>
|
||||
<dependency org="org.ognl" name="com.springsource.org.ognl" rev="2.6.9" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.aop" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context.support" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.jdbc" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.orm" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.transaction" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.aop" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context.support" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.jdbc" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.orm" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.transaction" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework.security" name="org.springframework.security" rev="2.0.2.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework.security" name="org.springframework.security.taglibs" rev="2.0.2.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework.webflow" name="org.springframework.js" rev="latest.integration" conf="compile->compile"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
<!-- test-time only dependencies -->
|
||||
<dependency org="org.easymock" name="com.springsource.org.easymock" rev="2.3.0" conf="test->compile" />
|
||||
<dependency org="org.junit" name="com.springsource.junit" rev="3.8.2" conf="test->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.test" rev="2.5.4.A" conf="test->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.test" rev="2.5.5.A" conf="test->compile"/>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -14,6 +14,15 @@
|
||||
</on-start>
|
||||
|
||||
<view-state id="enterBookingDetails" model="booking">
|
||||
<binder auto-bind="false">
|
||||
<binding property="checkinDate" converter="shortDate" required="true" />
|
||||
<binding property="checkoutDate" converter="shortDate" required="true" />
|
||||
<binding property="smoking" required="true" />
|
||||
<binding property="creditCard" required="true" />
|
||||
<binding property="creditCardName" required="true" />
|
||||
<binding property="creditCardExpirationMonth" required="true"/>
|
||||
<binding property="creditCardExpirationYear" required="true"/>
|
||||
</binder>
|
||||
<transition on="proceed" to="reviewBooking" />
|
||||
<transition on="cancel" to="cancel" bind="false" />
|
||||
</view-state>
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
<dependency org="org.hibernate" name="com.springsource.org.hibernate" rev="3.2.6.ga" conf="optional, test->compile" />
|
||||
<dependency org="org.junit" name="com.springsource.junit" rev="3.8.2" conf="provided, test->compile" />
|
||||
<dependency org="org.ognl" name="com.springsource.org.ognl" rev="2.6.9" conf="optional->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.orm" rev="2.5.4.A" conf="optional->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.transaction" rev="2.5.4.A" conf="optional->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.web" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.portlet" rev="2.5.4.A" conf="optional->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="2.5.4.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.beans" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.core" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.orm" rev="2.5.5.A" conf="optional->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.transaction" rev="2.5.5.A" conf="optional->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.web" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.web.portlet" rev="2.5.5.A" conf="optional->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.web.servlet" rev="2.5.5.A" conf="compile->compile"/>
|
||||
<dependency org="org.springframework.security" name="org.springframework.security" rev="2.0.0.A" conf="optional->compile" />
|
||||
<dependency org="org.springframework.webflow" name="org.springframework.binding" rev="latest.integration" conf="compile->compile"/>
|
||||
<dependency org="org.springframework.webflow" name="org.springframework.js" rev="latest.integration" conf="compile->compile"/>
|
||||
@@ -51,9 +51,9 @@
|
||||
<dependency org="org.easymock" name="com.springsource.org.easymock" rev="2.3.0" conf="test->compile" />
|
||||
<dependency org="org.hsqldb" name="com.springsource.org.hsqldb" rev="1.8.0.9" conf="test->compile" />
|
||||
<dependency org="org.jboss.el" name="com.springsource.org.jboss.el" rev="2.0.0.GA" conf="test->compile"/>
|
||||
<dependency org="org.springframework" name="org.springframework.aop" rev="2.5.4.A" conf="test->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.jdbc" rev="2.5.4.A" conf="test->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.test" rev="2.5.4.A" conf="test->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.aop" rev="2.5.5.A" conf="test->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.jdbc" rev="2.5.5.A" conf="test->compile" />
|
||||
<dependency org="org.springframework" name="org.springframework.test" rev="2.5.5.A" conf="test->compile" />
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2004-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.webflow.engine.model;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
/**
|
||||
* Model support for the view-state binder element.
|
||||
* @author Scott Andrews
|
||||
*/
|
||||
public class BinderModel extends AbstractModel {
|
||||
|
||||
private String autoBind;
|
||||
|
||||
private LinkedList bindings;
|
||||
|
||||
public String getAutoBind() {
|
||||
return autoBind;
|
||||
}
|
||||
|
||||
public void setAutoBind(String autoBind) {
|
||||
this.autoBind = autoBind;
|
||||
}
|
||||
|
||||
public LinkedList getBindings() {
|
||||
return bindings;
|
||||
}
|
||||
|
||||
public void setBindings(LinkedList bindings) {
|
||||
this.bindings = bindings;
|
||||
}
|
||||
|
||||
public boolean isMergeableWith(Model model) {
|
||||
return model instanceof BinderModel;
|
||||
}
|
||||
|
||||
public void merge(Model model) {
|
||||
BinderModel binder = (BinderModel) model;
|
||||
setAutoBind(merge(getAutoBind(), binder.getAutoBind()));
|
||||
setBindings(merge(getBindings(), binder.getBindings()));
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class ViewStateModel extends AbstractTransitionableStateModel {
|
||||
|
||||
private LinkedList vars;
|
||||
|
||||
private LinkedList bindings;
|
||||
private BinderModel binder;
|
||||
|
||||
private LinkedList onRenderActions;
|
||||
|
||||
@@ -71,7 +71,7 @@ public class ViewStateModel extends AbstractTransitionableStateModel {
|
||||
setPopup(merge(getPopup(), state.getPopup()));
|
||||
setModel(merge(getModel(), state.getModel()));
|
||||
setVars(merge(getVars(), state.getVars(), false));
|
||||
setBindings(merge(getBindings(), state.getBindings(), false));
|
||||
setBinder((BinderModel) merge(getBinder(), state.getBinder()));
|
||||
setOnRenderActions(merge(getOnRenderActions(), state.getOnRenderActions(), false));
|
||||
}
|
||||
|
||||
@@ -174,31 +174,12 @@ public class ViewStateModel extends AbstractTransitionableStateModel {
|
||||
vars.add(var);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the bindings
|
||||
*/
|
||||
public LinkedList getBindings() {
|
||||
return bindings;
|
||||
public BinderModel getBinder() {
|
||||
return binder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bindings the bindings to set
|
||||
*/
|
||||
public void setBindings(LinkedList bindings) {
|
||||
this.bindings = bindings;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param var the var to add
|
||||
*/
|
||||
public void addBinding(BindingModel binding) {
|
||||
if (binding == null) {
|
||||
return;
|
||||
}
|
||||
if (bindings == null) {
|
||||
bindings = new LinkedList();
|
||||
}
|
||||
bindings.add(binding);
|
||||
public void setBinder(BinderModel binder) {
|
||||
this.binder = binder;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -214,4 +195,5 @@ public class ViewStateModel extends AbstractTransitionableStateModel {
|
||||
public void setOnRenderActions(LinkedList onRenderActions) {
|
||||
this.onRenderActions = onRenderActions;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.springframework.webflow.engine.model.AbstractStateModel;
|
||||
import org.springframework.webflow.engine.model.ActionStateModel;
|
||||
import org.springframework.webflow.engine.model.AttributeModel;
|
||||
import org.springframework.webflow.engine.model.BeanImportModel;
|
||||
import org.springframework.webflow.engine.model.BinderModel;
|
||||
import org.springframework.webflow.engine.model.BindingModel;
|
||||
import org.springframework.webflow.engine.model.DecisionStateModel;
|
||||
import org.springframework.webflow.engine.model.EndStateModel;
|
||||
@@ -518,6 +519,18 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
private BinderModel parseBinder(Element element) {
|
||||
Element binderElement = DomUtils.getChildElementByTagName(element, "binder");
|
||||
if (binderElement != null) {
|
||||
BinderModel binder = new BinderModel();
|
||||
binder.setAutoBind(binderElement.getAttribute("auto-bind"));
|
||||
binder.setBindings(parseBindings(binderElement));
|
||||
return binder;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private LinkedList parseBindings(Element element) {
|
||||
List bindingElements = DomUtils.getChildElementsByTagName(element, "binding");
|
||||
if (bindingElements.isEmpty()) {
|
||||
@@ -594,7 +607,7 @@ public class XmlFlowModelBuilder implements FlowModelBuilder {
|
||||
state.setPopup(element.getAttribute("popup"));
|
||||
state.setModel(element.getAttribute("model"));
|
||||
state.setVars(parseVars(element));
|
||||
state.setBindings(parseBindings(element));
|
||||
state.setBinder(parseBinder(element));
|
||||
state.setOnRenderActions(parseOnRenderActions(element));
|
||||
state.setAttributes(parseAttributes(element));
|
||||
state.setSecured(parseSecured(element));
|
||||
|
||||
@@ -327,33 +327,68 @@ fully-qualified class name (e.g. 'java.lang.Integer'). The class must be a conc
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="binding" minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:element name="binder" minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[
|
||||
A view model binding. A binding connects a UI element in this view to a model property.
|
||||
Configures the process of binding UI elements such as form fields to model properties.
|
||||
]]>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="property" type="xsd:string" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[
|
||||
<xsd:sequence>
|
||||
<xsd:element name="binding" minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[
|
||||
Defines a view model binding. A binding connects a UI element in this view to a model property.
|
||||
]]>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="property" type="xsd:string" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[
|
||||
The name of the model property to bind to.
|
||||
]]>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="converter" type="xsd:string">
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="converter" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[
|
||||
The name of a custom converter to use to format the property for display in the UI.
|
||||
]]>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="required" type="xsd:boolean">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[
|
||||
Indicates if this binding is required. A required binding generates an error when setting a null or empty value.
|
||||
A binding that is not required allows null and empty values to be bound.
|
||||
]]>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="auto-bind" type="xsd:boolean">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[
|
||||
The name of a custom converter to use to format the property for display in the UI.
|
||||
Toggles automatic model binding. If true, binding between request parameters and model properties occurs automatically by convention.
|
||||
For example, the request parameter "firstName" might map to property "firstName" on a Person model.
|
||||
If false, binding must be explicitly enabled per property by configuring one or more binding elements.
|
||||
The default, if not overridden, is true.
|
||||
]]>
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="on-entry" minOccurs="0">
|
||||
|
||||
@@ -152,8 +152,9 @@ public class XmlFlowModelBuilderTests extends TestCase {
|
||||
FlowModel flow = builder.getFlowModel();
|
||||
ViewStateModel model = (ViewStateModel) flow.getStates().get(0);
|
||||
assertEquals("formObject", model.getModel());
|
||||
assertEquals("objectProperty", ((BindingModel) model.getBindings().get(0)).getProperty());
|
||||
assertEquals("customConverter", ((BindingModel) model.getBindings().get(0)).getConverter());
|
||||
assertEquals("true", model.getBinder().getAutoBind());
|
||||
assertEquals("objectProperty", ((BindingModel) model.getBinder().getBindings().get(0)).getProperty());
|
||||
assertEquals("customConverter", ((BindingModel) model.getBinder().getBindings().get(0)).getConverter());
|
||||
}
|
||||
|
||||
public void testViewStateRedirect() {
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
|
||||
|
||||
<view-state id="form" model="formObject">
|
||||
<binding property="objectProperty" converter="customConverter"/>
|
||||
<binder auto-bind="true">
|
||||
<binding property="objectProperty" converter="customConverter" required="true" />
|
||||
</binder>
|
||||
</view-state>
|
||||
|
||||
</flow>
|
||||
Reference in New Issue
Block a user