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 Listening for a link selection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Listening for a link selection" Watch "Listening for a link selection" New topic
Author

Listening for a link selection

Michael Zellmann
Greenhorn

Joined: Dec 17, 2004
Posts: 18
I am new to JSF, and working on an application where the user is shown a DataTable of possible links. Each is represented in an <hutputLink component. When that link is chosen, the user sees the requested page in a new window - all behavior as intended. I want to implement a Listener that will capture what link the user chose. When I try to add a <f:actionListener type=... component, I get an error that an action listener can only be nested within a component that is a Faces ActionSource. (that make sense) However, the only components that do that are HtmlCommandButton, HtmlCommandLink and UICommand. I don't see how to accomplish what I am looking for. What can I do?
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

Why can't you use a commandLink?
Michael Zellmann
Greenhorn

Joined: Dec 17, 2004
Posts: 18
Thanks for the reply. With your suggestion, I got it to work! Had to do some fiddling to get the href link and the title to work out. Also had to wrap it in a <h:form tag> even though I don't need any servlet handling.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Listening for a link selection
 
Similar Threads
A4j issue
HttpSessionListener does not work with Tomcat 4.1.24
SEVERE: Error listenerStart
Populating Datatable from Database
HtmlCommandLink in a custom component