Correct navigation handling

UI Components for JSF
Post Reply
Posts: 11
Joined: 05 Sep 2009, 00:43

09 Sep 2009, 10:46


We have recently been porting a JSF application from ICE faces to Primefaces...

We have had one or two issues which I was hoping some experienced prime faces users could answer.

1. How is simple navigation done using PrimeFaces commandLink?? After porting from iceFaces commandLink our navigation actions are ignored??

For example....

Code: Select all

<p:commandLink actionListener="#{aggregationSearchOptions.confirmFlights}" action="#{aggregationSearchOptions.getOutcomeView}"  />
should invoke method 'confirmFlights' and then forward to view getOutcomeView()?? But the request returns and no redirection/forward occurs? Am I missing something?

2. Is there any reason why after a page submit, the scolling for the window jumps to the top of the page? The page refocuses after a response is received?

Thanks you all

Posts: 18045
Joined: 05 Jan 2009, 00:21
Location: Cybertron

09 Sep 2009, 20:13


1) p:commandLink is for ajax only, if you need to navigate another page I suggest using h:commandLink.

2) Is the submit you mentioned a full page submit without ajax? Can you provide a simple code fragment please?

If you have any other questions, feel free to ask :)

Posts: 11
Joined: 05 Sep 2009, 00:43

09 Sep 2009, 22:59

Hi civici,

Thanks you for your response, regarding the page jumping issues, here is an abbreviated code snippit.

The intended action is to sort a result set on the screen, the results are shown on the screen using partial refresh. The functionality works as expected, except for the browser window scrolling to the top and then re-focusing after the partial refresh.

Code: Select all

<h:form id="flightOptionsForm_#{headingText}">


<ul class="tabs">
                                    <c:if test="#{headingText eq 'Return'}">
                                    <li class="#{(aggregationSearchOptions.flightOptionsConversationBean.currentInboundSortType eq 'PRICE') ? 'active' : ''} #{(aggregationSearchOptions.flightOptionsConversationBean.currentInboundSortType != 'DEPARTURE' and aggregationSearchOptions.flightOptionsConversationBean.currentInboundSortType != 'DURATION') ? 'active' : ''}"><p:commandLink immediate="true" update="flightOptionsForm_Return" id="PRICE_#{headingText}" styleClass="sort-by-price" actionListener="#{aggregationSearchOptions.sortOptions}" oncomplete="selectRadioButton( 'flightOptionsForm_#{headingText}' )" >price</p:commandLink></li>

... Other components in a UI Repeat...

Also, some feedback, it would be a nice feature if the mouse pointer went to a "hour glass" after a partial submit to signify to the user that a request is in progress (This may not be primefaces responsibility but its a "nice to have" option). We have had to implement this functionality our selves. I imagine it would be a common requirement for users with long running ajax requests.



Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests