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 Trying to figure out java code to bind to outputLinks generated from a4j:repeat tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "Trying to figure out java code to bind to outputLinks generated from a4j:repeat tags" Watch "Trying to figure out java code to bind to outputLinks generated from a4j:repeat tags" New topic
Author

Trying to figure out java code to bind to outputLinks generated from a4j:repeat tags

Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

This is the jsf code:


This essentially is just a List of Devices, each one also an outputLink sending the user to another jsf page that has two fields bound to java variables - deviceId and deviceName.

So I need to have a way to carry over the Device data depending on which link the user clicks on. I have an idea how to do so but Im not there yet. Here is what i have been working on:



Now this is not working yet of course, particularly line 3 is underlined with this error:
Cannot cast from Component to Device

So Im not sure what needs to be changed here. Is (MouseEvent event) the correct thing to go in between the parentheses or does that need to be something else like (FacesContext event)?
If MouseEvent event will work, I'm sure all I need is some line to go before that third line that first casts event to something else that is then castable to Device.

When I did this in reference to my rich:tree I used:



This works for clicking on a tree node but I need something for clicking on a command Link


True wisdom is in knowing you know nothing - Socrates
Rami Hailat
Greenhorn

Joined: Nov 26, 2008
Posts: 20
hi Matt,

you code will not work cause you bind an instance of outputLink to a method on the managed bean, and not an instance of
outputLink. so create a variable of type outputLink name it myOtputLink
and replcae line 3 with this
 
GeeCON Prague 2014
 
subject: Trying to figure out java code to bind to outputLinks generated from a4j:repeat tags