File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Facelets+JSF2.0 CommandLink action method not called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Facelets+JSF2.0 CommandLink action method not called" Watch "Facelets+JSF2.0 CommandLink action method not called" New topic
Author

Facelets+JSF2.0 CommandLink action method not called

H Li
Greenhorn

Joined: Mar 21, 2011
Posts: 2
After convert JSP+JSF1.2+javaEE5 to FaceLes+JSF2.0+EE6, the commandLink not work any more

The step flow is as following:
1) After user invokes one Bean's action method, a object of type List<Custome> is created & then put in the requestScope with a key "customers"
2) After that,the the page gets rendered(see code below).
3) Click the command link, the action="#{customerBean.viewCustomerAddress}" is not called
4) Change "#{customer.id}" to constant, action method still not called
5) Use tag c:forEach, still not working.


Any one has a idea?

Thanks


H Li
Greenhorn

Joined: Mar 21, 2011
Posts: 2
If the data object customers of List<Customer> is put into session scope, the commandLink will work.

it seems to me, facelets enforce that the view must be restored before the commandLink click takes effect.

It really ridiculous because the date is already there, why bather to get the data once more.on the other hand, JSP no such problem.

Any one has better idea how to get around this issue, since too much work to change my JSP+JSF1.2 APP

Thank you

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632
    
  15

It is a fundamental part of the JSF lifecycle that the first phase is the View Restore Phase, and that's the same with/without Facelets.

JSF iteration controls generally maintain a cursor to do their work, and the only way that the cursor can function properly is if the referenced datamodel is in a non-transient scope. For JSF1, that means Session Scope or higher. For JSF2, View Scope or higher.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Facelets+JSF2.0 CommandLink action method not called
 
Similar Threads
ajax events not triggered in dynamically included pages
problems with a commandLink inside a rich:datagrid
Related to tree2 of tomahak
using jsp:include to add jsf navigation
<h:commandLink> is not able to invoke backing bean method