You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 19 Members of 4504 |
| Forum: Seam Users |
28. Mar 2008, 14:58 CET | Link |
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
2 Replies: | |||
|---|---|---|---|
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. |
|||
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 Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. (Albert Einstein) |