2 Replies Latest reply on Oct 26, 2007 3:48 PM by Ben Ludkiewicz

    Passing dynamic values to enhanced el expression

    Ben Ludkiewicz Newbie

      Hi all,

      I have a button whose value I'm trying to pass to my bean using Seam's enhanced EL. Below is a snippet from my xhtml page:

      <h:form>
       <c:forEach var="answer" items='#{ testing.test.currentQuestion.answers }'>
       <h:commandButton value='#{ answer.name }' action='#{ testing.scoreQuestion( answer.name ) }' />
       </c:forEach>
      </h:form>
      


      This will always pass a null reference to the testing.scoreQuestion( String ) method. I have also tried #{ testing.scoreQuestion( ${answer.name} ) } and #{ testing.scoreQuestion( #{answer.name} ) } but I get errors as it tries to evaluate #{${answer.name}} and #{#{answer.name}}, respectively. So, if that's the case then why is #{ answer.name } evaluating to null for the action yet the button renders with the proper value of #{ answer.name }? Is there another way of accomplishing this or am I just missing something obvious? Any help would be appreciated.

      Thanks,
      -=B=-