users@glassfish.java.net

RE: JSF - commandLink and dataTable issue

From: Manfred Riem <mriem_at_manorrock.org>
Date: Wed, 27 Sep 2006 08:52:39 -0600

You probably want to post your doFindItems ;)

 

Kind regards,
Manfred Riem

mriem_at_manorrock.org

http://www.manorrock.org/

 

 

  _____

From: Antonio Goncalves [mailto:antonio.mailing_at_gmail.com]
Sent: Wednesday, September 27, 2006 8:51 AM
To: users_at_glassfish.dev.java.net
Subject: JSF - commandLink and dataTable issue

 

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