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

Wrong binding properties inside a subflow call

    XMLWordPrintable

    Details

      Description

      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">
      		<on-render>
      			<set name="viewScope.eliminar" value="true" type="boolean" />
      			<set name="viewScope.eliminarFlowBundle" value="'botonera.eliminar.title'" />
      		
      			<evaluate expression="usuarioListActionFlow.list()" />
      		</on-render>
      		<transition on="editItem" to="editItem" />
      	</view-state>
      	
      	<subflow-state id="editItem" subflow="usuario">
      		<input name="id" value="requestParameters.id" />
      
      		<transition on="cancelarFlow" to="usuarioList" />
      	</subflow-state>
      </flow>
      

      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" />
      	</decision-state>
      
      	<action-state id="edit">
      		<evaluate expression="daoManager.getObject(usuarioFormBean.getClass(),id)"
      			result="usuarioModel" />
      		
      		<transition to="usuarioInput" />
      	</action-state>
      	
      	<view-state id="usuarioInput" view="/jsf/seguridad/usuarioForm.xhtml">
      		<on-render>
      			<set name="viewScope.salvar" value="true" type="boolean" />
      			<set name="viewScope.salvarFlowBundle" value="'botonera.salvar.title'" />
      			
      			<evaluate expression="usuarioModel.fillPOJO()" />
      		</on-render>
      		<transition on="salvar">
      			<evaluate expression="usuarioActionFlow.save(usuarioModel,messageContext)" />
      			<render fragments="usuarioForm" />
      		</transition>
      	</view-state>
      	
      	<on-end>
      		<evaluate expression="externalContext.sessionMap.remove('usuarioActionFlow')"/>
      	</on-end>
      </flow>
      

      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.!!

        Attachments

          Activity

            People

            Assignee:
            rstoya05-aop Rossen Stoyanchev
            Reporter:
            hdacosta Harold Da Costa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: