In my JSF page I have a combobox that updates a table when an item of the combobox is selected.
The table contains items with an edit link.
The problem is when the table is changed by the combobox you need to click twice on the link to go to the page. The first click just refresh the page.
Here is the xhtml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<body>
<ui:composition template="/template.xhtml">
<ui:define name="windowTitle">Comment packages</ui:define>
<ui:define name="content">
<h3>Select the package to comment.</h3>
<h:form prependId="false">
Section:
<h:selectOneMenu id="selectSection" value="#{platformService.currentSection}">
<f:ajax render=":list-packages" />
<f:selectItems value="#{platformService.releasePlatform.sections}" />
</h:selectOneMenu>
</h:form>
<p/>
<h:panelGroup id="list-packages">
<h:dataTable id="packageList" var="package" value="#{packageService.packages}" border="1" >
<h:column>
<f:facet name="header">Package name</f:facet>
#{package.name}
</h:column>
<h:column>
<h:form>
<h:commandlink action="#{commentService.commentPackage}" value="Comment">
<f:param name="packageName" value="#{package.name}" />
</h:commandLink>
</h:form>
</h:column>
</h:dataTable>
</h:panelGroup>
</ui:define>
</ui:composition>
</body>
</html>
I've also tried with commandButton but you also need to click twice on the button.
I'm running JSF 2.0.1-FCS in Maven/Jetty.