users@glassfish.java.net

RE: JSF - commandLink and dataTable issue

From: <jacob_at_hookom.net>
Date: Wed, 27 Sep 2006 10:55:58 -0400
Your first example looks correct-- usually you only declare one h:form per page that surrounds all other components.  You can put in multiple h:forms, but only to separate state.  If you opt to use some of the ADF components with glassfish, I believe there are subform components available for use to break up page processing in delegated scopes.

When you run into a case where you think you have the page right, but clicking just refreshes the page, you may want to check the logs or include an h:messages in your page since often times it ends up being a failed coversion or validation in the page.

http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/h/messages.html

 
There is no dedicated JSF mailing list for Glassfish, I hope this is the correct list to post on JSF.
 
 
Hi,
 
I'm using Glassfish V2b13 with JSF 1.2 and I have a problem with commandLink inside dataTable. It just doesn't work. I've read on older mailing lists (like 2 years ago) that it was a known bug and it should be solved in future versions (it was JSF 1.1 at the time). Imagine the petstore application, with a navigation bar that gives you the products for a given category, the list of product is displayed with a link, when you click on it it shows the items for this given product (master/detail kind of thing).
 
First, I've tried commandLink inside dataTable but when clicking the page remains the same :
 
        <h:form>
            <h:dataTable value="#{catalog.products}" var="product">
                <h:column>
                    <h:panelGroup>
                        <h:commandLink action="#{ catalog.doFindItems}">
                            <h:outputText value="a l interieur du panel group"/>
                            <f:param name="productId" value="1"/>
                        </h:commandLink><br/>
                    </h:panelGroup>
                </h:column>
            </h:dataTable>
        </h:form>
 
I've tried to move the form tag around the commandLink but it still doesn't work
 
        <h:dataTable value="#{catalog.products}" var="product">
            <h:column>
                <h:panelGroup>
                    <h:form>
                        <h:commandLink action="#{ catalog.doFindItems}">
                            <h:outputText value="a l interieur du form"/>
                            <f:param name="productId" value="1"/>
                        </h:commandLink><br/>
                    </h:form>
                </h:panelGroup>
            </h:column>
        </h:dataTable>
 
And when I take my commandLink out of the dataTable, it works fine... but I can't iterate through my list
 
        <h:form>
            <h:commandLink action="#{catalog.doFindItems}">
                <h:outputText value="a l exterieur de la boucla dans le form"/>
                <f:param name="productId" value="1"/>
            </h:commandLink><br/>
        </h:form>
 
The fact that this is working shows that my navigation and back bean is working. Is it a bug, a limitation of JSF or is there another way to iterate over a collection without using the dataTable ?
 
Thanks,
 
Antonio