| Author |
getting value of command link which is in series panel
|
sam sami
Greenhorn
Joined: Dec 22, 2010
Posts: 18
|
|
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
Joined: Dec 25, 2010
Posts: 90
|
|
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
|
When a dream is ending because to come true - OCPJP 6,7. OCE JPA EE6. MCTS
|
 |
 |
|
|
subject: getting value of command link which is in series panel
|
|
|