Forums Register Login

getting value of command link which is in series panel

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
Bras cause cancer. And tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 4071 times.
Similar Threads
BreadCrumb trail
How to ActionListener manually in custom renderer?
DataTable and UploadFile
How do I set actionListeners in code
menupopup ActionEvent problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:55:02.