• 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

getting value of command link which is in series panel

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using the panelSeries component to iterate over a list of items and dynamically create commandLinks with different values and the same actionListener.

When I hard-code the value inside the command Link it is available in the actionListener method in the backing bean, but when i try to assign the value dynamically it is not available in the action listener.

What I do is :


Code:






my action listener :

public void test(ActionEvent actionEvent){
HtmlCommandLink commandLink = (HtmlCommandLink) actionEvent.getSource();
System.out.println(commandLink.getValue());
}

when i try:

Code:

<ice:commandLink value="1" actionListener="#{PackageDef.test}" />




the value is available ...


so can any one help me to find out how to get value of selected command link in backing bean.
 
Ranch Hand
Posts: 90
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sam

One way to solve your problem is passing a parameter or an attribute from your ice:commandLink, for example you can use a paramenter in the command link so and you can get this value in your backing bean, I post an example of how to do this in the following post Passing values from UI.
Regards
Cesar
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic