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 Passing user defined objects as request parameter in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Passing user defined objects as request parameter in JSF" Watch "Passing user defined objects as request parameter in JSF" New topic
Author

Passing user defined objects as request parameter in JSF

Ingoba Ningthoujam
Ranch Hand

Joined: Dec 04, 2006
Posts: 90
Hi

I have a list containing some user defined objects. I iterated the list and display in page.At the end of every row there is a command button. I want to sent each object in the list as a parameter. The following is the code I am using, it's not working .....

facultyList is a list in the class FacultyListAdminBean class. This list contains many objects of CpsFacultyListAdminVO.






Please Help. Thanks in advance.

[ March 20, 2008: Message edited by: Ingoba Ningthoujam ]
[ March 24, 2008: Message edited by: Ingoba Ningthoujam ]
Bob Good
Ranch Hand

Joined: Jan 09, 2008
Posts: 86
Can you try a command link instead? It is easier.
But if you really really want a button....


http://forum.java.sun.com/thread.jspa?messageID=2374166&tstart=0
[ March 20, 2008: Message edited by: Bob Good ]
Ingoba Ningthoujam
Ranch Hand

Joined: Dec 04, 2006
Posts: 90
Thanks Bob.

But I made a mistake in my question. I am using commandLink not commandButton.
Usually I used to send the member of the object as a parameter but what I want is to send the USER DEFINED object itself as a parameter. So, can you please send me the sample code.

Please Help.
Krishna Srinivasan
Ranch Hand

Joined: Jul 28, 2003
Posts: 1844

You can use dataTable and bind it with bean
http://www.javabeat.net/code/2007/09/jsf-h-datatable-h-selectbooleancheckbox/
[ March 23, 2008: Message edited by: Krishna Srinivasan ]

Krishna Srinivasan
Spring Tutorials, OCAJP Mock Questions, 400+ OCPJP Mock Questions
Ingoba Ningthoujam
Ranch Hand

Joined: Dec 04, 2006
Posts: 90
Thanks. But binding in Datatable we can use in that bean only. My requirement is to pass that value to another bean. On clicking on the link that I have mention in my code , a new pop up window will open and this page is associated with another bean.

please clarify more. Thanks in advance.
Bob Good
Ranch Hand

Joined: Jan 09, 2008
Posts: 86
The action listener for the command link can be a method in the other bean:

(a backing bean for the target page). Then just retrieve your parameter in the usual fashion:

[ March 25, 2008: Message edited by: Bob Good ]
Ingoba Ningthoujam
Ranch Hand

Joined: Dec 04, 2006
Posts: 90
Thank you very much.
 
wood burning stoves
 
subject: Passing user defined objects as request parameter in JSF
 
Similar Threads
Passing f:param with h:commandLink
passing parameters from JSF to Java class and JSF to JSF
Actions don't work inside a dataTable column?
html select onchange problem
Display data in columns