incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Döring Markus <>
Subject expressions in action attribute
Date Mon, 16 Oct 2006 12:39:36 GMT

i'm using MyFaces 1.1.4, Trinidad M1 Snapshot and Facelets on an JBoss 4.x Server.


What I want to do is the following:

I have a <tr:table> with some data displayed. On each entry there can be performed actions
(like edit / remove / ect) but the actions change depending on application-status.

I have a managedBean with a HashMap containing the actions:






In the value I've tried to

1.	use the name of a class the extends javax.faces.event.ActionListener
2.	use an actionMethode like beanName.methode



My JSP-Code is something like this for 1.:



            <c:forEach var="action" items="#{managedBean.actions}"> //return the keySet
of the HashMap


                        <tr:commandButton text="#{action}">

                              <f:actionListener type="managedBean.actionMap[action]}" />






            or for 2.:



            <c:forEach var="action" items="#{ managedBean.actions}">               


                        <tr:commandButton text="#{action}" action="#{managedBean.actionMap[action]}"





The first try failes because it is not allowed to set the type attribute via an EL, that's
no fine but I think that has something to do with MyFaces implementation and ok so far.

The second try failes because the expression is not evaluated correct. Excpetion says there
is no actionMethode called

{actionname1, managedBean.actionMethode1; actionname2, managedBean.actionMethode2, ...}.actionname1()

so looks like the complete map is used for the beanName and the name of the Action is used
as Methode. 

Do I something complete wrong, is this a bug in EL or is this in some king intended to work
as it do?


And to mention: I use the c:forEach because I'm using facelets. I need the forEach, declaring
alle actinos by hand and just set the rendered attribute if they needed or not is not an option.


Thanks for any help



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message