I'm trying out MyFaces CODI with it's wonderful features. A very useful thing is the typesafe navigation. I can specify the outcome of an action method in my controller bean like this:
public Class<? extends ViewConfig> goBack() {
return Pages.ListView.class;
}
That is really cool because the excessive refactoring ability of every development IDE.
But when I want to use this feature I have a problem with passing viewParameter to the next view. I have to use a commandbutton for calling this action method like this:
<h:commandButton id="backButton" value="#{msgs.Button_Back}"
action="#{viewBean.goBack()}" />
If I use this commandbutton I cannot pass parameters. A "normal" button or a link would do it:
<h:button id="backButton" value="#{msgs.Button_Back}" outcome="siteBefore.xhtml">
<f:param name="itemId" value="5" />
</h:button>
The disadvantage is that the "normal" button don't use the action method and therefore I cannot participate on the advantage of typesafe navigation of CODI.
So is there any possibility to combine these two features? (passing viewparams and use typesafe navigation)
Thanks in advance!