title: Problem accessing "selectedRow" in nested dataTables
body: <p>I've been playing around with the spring web flow hotel booking application and have extended it a bit to try to get a better understanding of how spring web flow and JSF integrate together.  The spring documentation isn't that great in this area and it has been my impression that things work until you change them and then there is no clear documentation describing how it worked in the first place so you don't know how you broke it.  </p>
  
  <p>Anyway, hopefully you're familiar with the spring web flow hotel booking sample application.  If you're not, the main flow accepts search criteria and returns a list of hotels and then a hotel can be selected and then its information is displayed.  I'm trying to extend it so that when you're looking at a hotel, you can then view information about individual hotel rooms.</p>
  
  <p>here is the code for the flow:</p>
  
  <pre><code>    &lt;view-state id="reviewHotels"&gt;
      &lt;on-render&gt;
          &lt;evaluate expression="bookingService.findHotels(searchCriteria, flowRequestContext)" result="viewScope.hotels" result-type="dataModel" /&gt;
      &lt;/on-render&gt;
      &lt;transition on="select" to="reviewHotel"&gt;
          &lt;set name="flowScope.hotel" value="hotels.selectedRow" /&gt;
      &lt;/transition&gt;
  </code></pre>
  
  <p></p>
  
  <p>When you select a hotel it calls a pricing service.  Here is that view:</p>
  
  <pre><code>&lt;view-state id="reviewHotel" model="hotel"&gt;
      &lt;on-render&gt;
          &lt;evaluate expression="bookingService.priceHotel(flowScope.hotel, flowRequestContext)" result="flowScope.hotel"/&gt;
      &lt;/on-render&gt;
  
      &lt;transition on="price" to="displayPriceBreakdown"&gt;
          &lt;set name="flowScope.room" value="flowScope.hotel.rooms.selectedRow"&gt;&lt;/set&gt;
      &lt;/transition&gt;
  &lt;/view-state&gt;
  </code></pre>
  
  <p>The displayPriceBreakdown view then displays how the price was calculated when you click on a hotel price.  Here is the view config:</p>
  
  <pre><code>    &lt;view-state id="displayPriceBreakdown" view="displayPriceBreakdown.xhtml"&gt;
      &lt;on-entry&gt;
          &lt;render fragments="priceBreakdownFragment" /&gt;
      &lt;/on-entry&gt;
      &lt;transition on="back" to="reviewHotel"/&gt;
  &lt;/view-state&gt;
  </code></pre>
  
  <p>The reviewHotel.xhtml which shows the hotel details and its rooms looks like this:</p>
  
  <pre><code>&lt;ui:define name="content"&gt;
  &lt;div class="section"&gt;
  &lt;h2&gt;View Hotel&lt;/h2&gt;
  &lt;ui:fragment id="messages"&gt;
          &lt;div id="messagesInsertionPoint"&gt;
              &lt;h:messages errorClass="errors" /&gt;
          &lt;/div&gt;
  &lt;/ui:fragment&gt;
  
  &lt;h:form id="hotel"&gt;
      &lt;fieldset&gt;
          &lt;div class="field"&gt;
              &lt;div class="labelhotel"&gt;Name:&lt;/div&gt;
              &lt;div class="outputhotel"&gt;#{hotel.name}&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="field"&gt;
              &lt;div class="labelhotel"&gt;Address:&lt;/div&gt;
              &lt;div class="outputhotel"&gt;#{hotel.address}&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="field"&gt;
              &lt;div class="labelhotel"&gt;City:&lt;/div&gt;
              &lt;div class="outputhotel"&gt;#{hotel.city}&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="field"&gt;
              &lt;div class="labelhotel"&gt;Post Code:&lt;/div&gt;
              &lt;div class="outputhotel"&gt;#{hotel.zip}&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="field"&gt;
              &lt;div class="labelhotel"&gt;Country:&lt;/div&gt;
              &lt;div class="outputhotel"&gt;#{hotel.country}&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="field"&gt;
              &lt;div class="labelhotel"&gt;Amenities:&lt;/div&gt;
              &lt;div class="outputhotel"&gt;&lt;h:dataTable id="amentities" var="a" value="#{hotel.amenities}"&gt;
                                      &lt;h:column&gt;#{a.name} - #{a.description}&lt;/h:column&gt;&lt;/h:dataTable&gt;&lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="field"&gt;
              &lt;div class="labelhotel"&gt;Rooms:&lt;/div&gt;
              &lt;ui:fragment id="roomsFragment"&gt;
              &lt;div class="outputhotel"&gt;&lt;h:dataTable id="rooms" styleClass="summary" var="r" value="#{hotel.rooms}"&gt;
                                      &lt;h:column&gt;#{r.roomType} - #{r.bedType}&lt;/h:column&gt; 
                                      &lt;h:column&gt;&lt;sf:commandLink id="priceBreakdownLink" value="#{r.roomPrice} #{r.roomPriceCurrency}" action="price" processIds="priceBreakdownFragment"/&gt; &lt;/h:column&gt;
                                      &lt;h:column&gt;&lt;sf:commandLink id="bookHotelLink" value="Book Hotel" action="select"/&gt;&lt;/h:column&gt;
                                  &lt;/h:dataTable&gt;
              &lt;/div&gt;
              &lt;/ui:fragment&gt;
          &lt;/div&gt;
  
          &lt;div class="buttonGroup"&gt;
              &lt;h:commandButton id="cancel" action="cancel" value="Back to Search"/&gt;
          &lt;/div&gt;
      &lt;/fieldset&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p></p>
  
  <p>
  </p>
  
  <p>with the important bit being the dataTable used to display the hotel rooms:</p>
  
  <pre><code>            &lt;div class="field"&gt;
              &lt;div class="labelhotel"&gt;Rooms:&lt;/div&gt;
              &lt;ui:fragment id="roomsFragment"&gt;
              &lt;div class="outputhotel"&gt;&lt;h:dataTable id="rooms" styleClass="summary" var="r" value="#{hotel.rooms}"&gt;
                                      &lt;h:column&gt;#{r.roomType} - #{r.bedType}&lt;/h:column&gt; 
                                      &lt;h:column&gt;&lt;sf:commandLink id="priceBreakdownLink" value="#{r.roomPrice} #{r.roomPriceCurrency}" action="price" processIds="priceBreakdownFragment"/&gt; &lt;/h:column&gt;
                                      &lt;h:column&gt;&lt;sf:commandLink id="bookHotelLink" value="Book Hotel" action="select"/&gt;&lt;/h:column&gt;
                                  &lt;/h:dataTable&gt;
              &lt;/div&gt;
              &lt;/ui:fragment&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>The room information displays correctly however when the user clicks on a price then I want to show the price breakdown list for the particular room that was selected.  That is what I was hoping to accomplish with the:</p>
  
  <pre><code>        &lt;transition on="price" to="displayPriceBreakdown"&gt;
          &lt;set name="flowScope.room" value="flowScope.hotel.rooms.selectedRow"&gt;&lt;/set&gt;
      &lt;/transition&gt;
  </code></pre>
  
  <p>However when I run I get a NumberFormatException for selectedRow.</p>
  
  <pre><code>HTTP Status 500 -
  </code></pre>
  
  <p>type Exception report</p>
  
  <p>message</p>
  
  <p>description The server encountered an internal error () that prevented it from fulfilling this request.</p>
  
  <p>exception</p>
  
  <p>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction@34f67 targetAction = [SetAction@4db694 name = flowScope.room, value = flowScope.hotel.rooms.selectedRow, type = [null]], attributes = map[[empty]]] in state 'reviewHotel' of flow 'main' -- action execution attributes were 'map[[empty]]'
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:583)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
  root cause</p>
  
  <p>org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction@34f67 targetAction = [SetAction@4db694 name = flowScope.room, value = flowScope.hotel.rooms.selectedRow, type = [null]], attributes = map[[empty]]] in state 'reviewHotel' of flow 'main' -- action execution attributes were 'map[[empty]]'
      org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:60)
      org.springframework.webflow.engine.support.ActionTransitionCriteria.test(ActionTransitionCriteria.java:82)
      org.springframework.webflow.engine.support.TransitionCriteriaChain.test(TransitionCriteriaChain.java:71)
      org.springframework.webflow.engine.Transition.canExecute(Transition.java:195)
      org.springframework.webflow.engine.Transition.execute(Transition.java:211)
      org.springframework.webflow.engine.impl.FlowExecutionImpl.execute(FlowExecutionImpl.java:391)
      org.springframework.webflow.engine.impl.RequestControlContextImpl.execute(RequestControlContextImpl.java:214)
      org.springframework.webflow.engine.TransitionableState.handleEvent(TransitionableState.java:119)
      org.springframework.webflow.engine.Flow.handleEvent(Flow.java:555)
      org.springframework.webflow.engine.impl.FlowExecutionImpl.handleEvent(FlowExecutionImpl.java:386)
      org.springframework.webflow.engine.impl.RequestControlContextImpl.handleEvent(RequestControlContextImpl.java:210)
      org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:230)
      org.springframework.webflow.engine.ViewState.resume(ViewState.java:196)
      org.springframework.webflow.engine.Flow.resume(Flow.java:545)
      org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
      org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:163)
      org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
  root cause</p>
  
  <p>java.lang.NumberFormatException: For input string: "selectedRow"
      java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      java.lang.Integer.parseInt(Integer.java:449)
      java.lang.Integer.parseInt(Integer.java:499)
      javax.el.ListELResolver.coerce(ListELResolver.java:166)
      javax.el.ListELResolver.getValue(ListELResolver.java:51)
      javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
      org.springframework.binding.expression.el.DefaultELResolver.getValue(DefaultELResolver.java:80)
      org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
      org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
      org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
      org.springframework.binding.expression.el.BindingValueExpression.getValue(BindingValueExpression.java:54)
      org.springframework.binding.expression.el.ELExpression.getValue(ELExpression.java:54)
      org.springframework.webflow.action.SetAction.doExecute(SetAction.java:75)
      org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)
      org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145)
      org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)
      org.springframework.webflow.engine.support.ActionTransitionCriteria.test(ActionTransitionCriteria.java:82)
      org.springframework.webflow.engine.support.TransitionCriteriaChain.test(TransitionCriteriaChain.java:71)
      org.springframework.webflow.engine.Transition.canExecute(Transition.java:195)
      org.springframework.webflow.engine.Transition.execute(Transition.java:211)
      org.springframework.webflow.engine.impl.FlowExecutionImpl.execute(FlowExecutionImpl.java:391)
      org.springframework.webflow.engine.impl.RequestControlContextImpl.execute(RequestControlContextImpl.java:214)
      org.springframework.webflow.engine.TransitionableState.handleEvent(TransitionableState.java:119)
      org.springframework.webflow.engine.Flow.handleEvent(Flow.java:555)
      org.springframework.webflow.engine.impl.FlowExecutionImpl.handleEvent(FlowExecutionImpl.java:386)
      org.springframework.webflow.engine.impl.RequestControlContextImpl.handleEvent(RequestControlContextImpl.java:210)
      org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:230)
      org.springframework.webflow.engine.ViewState.resume(ViewState.java:196)
      org.springframework.webflow.engine.Flow.resume(Flow.java:545)
      org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
      org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:163)
      org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)</p>
  
  <p><strong>How should I pass the HotelRoom object into the displayPriceBreakdown fragment?</strong></p>
  
  <p>Many thanks if you've gotten this far and are reading and understanding this!  I've tried to be as thorough as possible however if more information is needed please let me know.</p>
  
  <p>Oh yes and Hotel as a variable called rooms which is a List and has getRooms : List and setRooms(List rooms) methods.</p>