myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject dataTable master/detail getRowData() - help needed
Date Fri, 21 Apr 2006 06:02:41 GMT
I'm trying to implement a master-detail type scenario where a search  
is performed to populate a dataTable with a list of users, the user  
name can then be clicked to view the details.

The method I am attempting to use is described on the Myfaces Wiki -
3) Getting handle to DataModel Row

When I have my managed bean set to session scope it all works fine,  
the only problem is that I don't want it in the session scope, once  
set to request scope the userDetails method does not get fired when I  
click on the commandLink, I simply get bumped back to the original  
view with a blank data table.

I have tried using <t:saveState..../> but I get an error as  
org.apache.myfaces.component.html.ext.HtmlDataTable is not serializable.

Relevant code:


   value="#{userAdmin.foundUsers}" var="user"
   <h:column id="col1">
     <f:facet name="header">
       <h:outputText value="#{msgs['']}" />
     <t:commandLink action="#{userAdmin.userDetails}"
       value="#{user.userId}" />
private UIData userTable;
public String userDetails()
        User appUser = (User) userTable.getRowData();
(getFacesContext(), appUser);
        return Constants.SUCCESS;

One thing particularly puzzling me is why the userDetails() method  
does not get fired at all when clicking the commandLink.
Being new to JSF it's probably my lack of understanding of the  
lifecycle but I'd appreciate some pointers as to how other people  
have solved this problem without resorting to placing the dataTable  
in the session scope.


View raw message