2 Replies Latest reply on Mar 28, 2008 3:39 PM by chawax

    A bug with action attribute on Seam button ?

    chawax

      Hi,


      I encounter a strange problem using Seam button JSF control. I want my button to call an action with parameters supplied by a ui:repeat. This ui:repeat is itself within a rich:datatable. Below is part of the code :


      <rich:dataTable value="#{listeDemandesAbsenceAValider}" var="task" rendered="#{not empty listeDemandesAbsenceAValider}">
          ...
          <rich:column>
              <ui:repeat value="#{task.transitions}" var="myTransition">
                  <s:button 
                      value="#{messageUtils.getDynamicMessage('label.demandeAbsence.', myTransition)}"
                      action="#{validationDemandesAbsenceAction.choisirTransitionTache(task.idTache, myTransition)}" />
              </ui:repeat>
          </rich:column>
      </rich:dataTable>



      The value attribute of my button works perfect. But the action parameter works bad. The variable task.idTache is well resolved, but the myTransition variable always returns an empty string. What is strange is that only one variable of both is not resolved and this variable is well resolved for value attribute !


      I could make it work by replacing s:button with a standard h:commandButton. So I really think this is a bug in Seam button.


      Anyone encountered the same problem ?


      Olivier

        • 1. Re: A bug with action attribute on Seam button ?
          damianharvey.damianharvey.gmail.com

          It's such a well known issue/feature that it's become something of a meme in this forum.


          The short answer is that when using s:link or s:button inside iterative components, you can't pass method parameters unless the list that you are iterating has been annotated with @DataModel.


          The long answer is to do a search on @DataModel and s:link and read section 32.1.2. Limitations and Hints of the docs.


          Cheers,


          Damian.

          • 2. Re: A bug with action attribute on Seam button ?
            chawax

            Shame on me ... I had not seen I was reading an old Seam documentation with no part about JBoss EL. As you said, everything is explained in the lastest one !


            Thanks a lot for your help,


            Olivier