commandLink inside datagrid doesn't fire correctly
coenos Mar 27, 2011 6:51 AMHi, I have the following form and a datagrid. Problem is the commandlink recalls/rerenders the same page instead of the correct url.
I've tried all sorts of tweaks, changing it to ajax doesn't even refresh the page. When I put the commandlinks outside of the dataGrid the links work fine.
Hope anyone knows a solution. Thanks,Coenos
<h:form styleClass="Content"> <rich:panel style=" width : 584px; height : 595px; float: center;"> <f:facet name="header"> <h:outputText value="Products"></h:outputText> </f:facet> <rich:dataGrid align="center" value="#{productRepos.getProductsByCategoryId(param.categoryId)}" var="product" columns="2" elements="9" width="550px" rendered="#{not empty productRepos.getProductsByCategoryId(param.categoryId)}"> <rich:panel bodyClass="pbody"> <f:facet name="header"> <h:outputText value="#{product.name}"></h:outputText> </f:facet> <h:panelGrid columns="2"> <h:panelGroup> <h:outputText value="Price:" styleClass="label"></h:outputText> <h:outputText value="#{product.currencyCode} #{product.price}" /> <br /> <h:outputText value="Rating:" styleClass="label"></h:outputText> <h:outputText value="#{product.rating}" /> <br /> <h:commandLink value="details" action="productdetails.xhtml"> <f:param name="productId" value="#{product.id}" /> </h:commandLink> <br /> <h:commandLink value="link" action="http://www.coenos.com" /> <br /> </h:panelGroup> <h:graphicImage width="40" height="50" style="float: right;" value="#{product.imageUrl}" /> </h:panelGrid> </rich:panel> </rich:dataGrid> </rich:panel> </h:form>