• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic