Mutualisation des boutons annuler et valider
Bonjour,
Je fais une maquette avec plusieurs ecrans en jsf. Et chaque ecran contient un bouton annuler et un bouton valider. Plutot que de faire des copier coller j'ai fait un include :
Code:
1 2 3 4
| <ui:include src="../../composants/commandButton.jspx">
<ui:param name="commandButtonAnnuler" value="antecedentBean.annulerAntecedent" />
<ui:param name="commandButtonValider" value="antecedentBean.validerAntecedent" />
</ui:include> |
et je passe 2 parametres qui correspondent au methode que j'appelle dans les differents bean
Et ma jsp include :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<table width="1024px" >
<tr>
<td width="800px"></td>
<td align="right" class="smallgraytext">
<h:commandButton immediate="true" action="#{commandButtonAnnuler}" value="Annuler" styleClass="button"/>
</td>
<td>
<h:commandButton immediate="true" action="#{commandButtonValider}" value="Valider" styleClass="button"/>
</td>
</tr>
</table>
</ui:composition> |
Le pb est que cela ne marche pas car il n'evalue pas le parametre comme une fonction ...
L'erreur est :
Code:
javax.servlet.ServletException: #{commandButtonValider}: javax.el.ELException: /composants/commandButton.jspx @15,108 action="#{commandButtonValider}": Identity 'commandButtonValider' does not reference a MethodExpression instance, returned type: java.lang.String
Avez vous deja eu cette erreur ou avez vous une meilleure solution pour mutualiser les boutons ?
Merci