Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-1394

Wrong binding properties inside a subflow call




      I have a form that performs a save and update operations, using nested properties, e.g. 'person.opcionSino.id' in a input form element, when I call this flow it performs the operation normally and each attribute is correctly mapped into the nested properties. The problem arises when I call this flow from another flow (subflow) when the subflow performs an action, the nested properties are bad mapped, thought I can see in the attributes map that the value comes with the right value, but in the pojo it changes the value incorrectly!!!

      Main Flow:

      	<view-state id="usuarioList" view="/jsf/seguridad/usuarioList.xhtml">
      			<set name="viewScope.eliminar" value="true" type="boolean" />
      			<set name="viewScope.eliminarFlowBundle" value="'botonera.eliminar.title'" />
      			<evaluate expression="usuarioListActionFlow.list()" />
      		<transition on="editItem" to="editItem" />
      	<subflow-state id="editItem" subflow="usuario">
      		<input name="id" value="requestParameters.id" />
      		<transition on="cancelarFlow" to="usuarioList" />

      The usuario flow:

      	<var name="usuarioModel" class="com.gvt.proactive.hibernate.model.Usuario" />
      	<input name="id" type="long" />
      	<decision-state id="createOrEdit">
      		<if test="id == null" then="usuarioInput" else="edit" />
      	<action-state id="edit">
      		<evaluate expression="daoManager.getObject(usuarioFormBean.getClass(),id)"
      			result="usuarioModel" />
      		<transition to="usuarioInput" />
      	<view-state id="usuarioInput" view="/jsf/seguridad/usuarioForm.xhtml">
      			<set name="viewScope.salvar" value="true" type="boolean" />
      			<set name="viewScope.salvarFlowBundle" value="'botonera.salvar.title'" />
      			<evaluate expression="usuarioModel.fillPOJO()" />
      		<transition on="salvar">
      			<evaluate expression="usuarioActionFlow.save(usuarioModel,messageContext)" />
      			<render fragments="usuarioForm" />
      		<evaluate expression="externalContext.sessionMap.remove('usuarioActionFlow')"/>

      Form of this flow (short):here we can see the nested properties defined on inputValue eg. 'usuarioModel.organizacion.id'

      <gvt:selectOneMenu inputId="organizacionSelectId" bundleLabel="#{bundle['usuario.organizacion.id']}"
      	inputValue="#{usuarioModel.organizacion.id}" items="#{organizacionItems}" itemLabel="razonOrganizacion"
      	itemValue="id" required="true" toolTip="toolTip.usuario.organizacion.id" />
      <gvt:selectOneRadio inputId="opcionSinoByEsActivaSelectId" bundleLabel="#{bundle['usuario.opcionSinoByEsActiva.id']}"
      	inputValue="#{usuarioModel.opcionSinoByEsActiva.id}" items="#{opcionSinoItems}"
      	itemLabel="nombreOpcionSino" itemValue="id" required="true" toolTip="toolTip.usuario.esCuentaActiva" />

      When it's called from a main flow, the nested properties has incorrect mapped values in the model, thought, in the request map it's correct, the problem is when binding to the model!Unable to render embedded object: File (, Remember, when this flow is called directly (not in subflow), the nested properties are correctly mapped and have the values that user choosed) not found.!!




            rstoya05-aop Rossen Stoyanchev
            hdacosta Harold Da Costa
            0 Vote for this issue
            0 Start watching this issue