I'm modernizing a JSF web application I took over from someone who retired and is not available for questions.
Current job is to simplify a h:dataTable. Each record has a commandLink to go to the corresponding details page.
Old version: action method openDetail(), determined the selected record by binding of the dataTable and looping trough the records to get the row.
New version: action method is now openDetail(Long id) and of course I added the parameter to the command link as well.
My action method is called with the correct parameter, I verified this by adding some log output. But the navigation-rule is not effective anymore. Although the action method returns the correct outcome, it stays on the page with the table.
The navigation-rule in faces-config.xml looks like this:
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-action>#{myBean.openDetail}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/mysks/detail.xhtml</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
Do I need to adapt the navigation-rule ? Does JSF make a difference for overloaded action methods ?