• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

param needs unique ID even if in different forms?

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to incorporate Jsptags' Pager taglib in my JSF application
but I am stuck with this problem...

I'm using JSF1.1 RI...

The taglib has a pages tag, that sets up the clickable links to jump to certain pages.
When I click on the link, the associated action is not called.

The <previous> link works, but the <pages> links doesn't.
The only difference I can see is that the <pages> is called multiple times.

Initially, I had one form, but I kept getting the duplicate id error.
Since I cannot append to the id attribute to make it unique,
I decided to make each link a form...

I don't know if this is an issue but the <pages> param id is the same,
although they belong to different forms.
Can anyone verify if this is a bug or not?

Even if I leave out the id in the hope that the
compiler generate an id for each link, the same problem happens.

I attempted to append a number to the id attribute to make it unique,
like this id="pagesp#{pageNumber}", but it is not accepted by the compiler.

Anybody has an idea how to get this to work?

<CODE>
<pg :p rev>
<h:form>
<%request.setAttribute("pagerOffset", GeneralAction.extractOffset(pageUrl));%>

<h:commandLink id="prev" value="<<Previous"
action="#{groupingAction.search}">
<f :p aram id="prevp" name="pager.offset" value="#{pagerOffset}" />
</h:commandLink>
</h:form>
</pg :p rev>



<pg :p ages>
<h:form>
<c:set scope="request" var="pageNumber" value="${pageNumber}" />
<%request.setAttribute("pagerOffset", GeneralAction.extractOffset(pageUrl));%>

<h utputText value="#{pageNumber}"
rendered="#{pageNumber==currentPageNumber}" />

<h:commandLink id="pages" value="#{pageNumber}"
action="#{groupingAction.search}"
rendered="#{pageNumber!=currentPageNumber}">
<f :p aram id="pagesp" name="pager.offset" value="#{pagerOffset}" />
</h:commandLink>
</h:form>
</pg :p ages>

</CODE>
[ May 25, 2005: Message edited by: Oliver Chua ]
 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe you can only have one form per page using jsf. I think they are trying to overcome this limitation in the second release of jsf. This may be where you problem is coming from.
 
Oliver Chua
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>I believe you can only have one form per page using jsf.
I'm posting a simplified version that recreates the problem...

This code tries to make 2 commandLinks, effectively creating 2 forms on the page. then it tries to insert the same 2 commandLinks inside a dataTable.

The behavior is as expected for the independent commandLinks. This would debunk the assertion that JSF1.1 does not support multiple forms in one page.

For the commandLinks inside the dataTable, the behavior is not the expected one. It does not forward to the next jsp.

Can anyone figure out why?

Page with form



Result Page


Faces-config

[ May 31, 2005: Message edited by: Oliver Chua ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic