• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting value of command link which is in series panel

 
sam sami
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • 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.
 
Cesar Loachamin
Ranch Hand
Posts: 90
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic