Hello,

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:

<Map>

            <entry>

                        <key>actionName</key><value>action</value>

            </entry>

</Map>

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.:

 

<tr:table>

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

                  <tr:column>

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

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

                        </tr:commandButton>

                  </tr:column>

            </c:forEach>

      </tr:table>

 

            or for 2.:

 

<tr:table>

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

<tr:column>

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

                  </tr:column>

            </c:forEach>

      </tr:table>

 

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

Greetings

Markus

Reply via email to