how can i know which link has been clicked by user in JSF
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   shree_bathina
Posted On:   Tuesday, April 10, 2007 03:05 AM

hi all, i am using to display the differnt links. whenever user clicks any of those links, i have to display corresponding details of that clicked one in another jsf page.i want to pass some value to the bean, that value depends on the link clicked on. here is my code... <%ApproveBean a = new ApproveBean(); ArrayList categories = new ArrayList(); categories = a.getCategories();%> <%for (int i = 0; i < categories.size(); i++) {%> <%=categories.get(i)%> <%ArrayList values = new ArrayList(); values = a.getPendingList(String.valueOf(categories.get(i))); for (int j = 0; j < values.size(); j =   More>>


			

hi all,
i am using to display the differnt links.
whenever user clicks any of those links,
i have to display corresponding details of that clicked one in another jsf page.i want to pass some value to the bean, that value depends on the link clicked on.

here is my code...



<%ApproveBean a = new ApproveBean();
ArrayList categories = new ArrayList();
categories = a.getCategories();%>
<%for (int i = 0; i < categories.size(); i++) {%>
<%=categories.get(i)%>
<%ArrayList values = new ArrayList();
values = a.getPendingList(String.valueOf(categories.get(i)));
for (int j = 0; j < values.size(); j = j + 6) {
%>

<%=values.get(j+1)%>


<%}
}%>


i have been trying to solve this since 3 days.
please some one help me...

thanks in advance,
Shree Bathina.


   <<Less

Re: how can i know which link has been clicked by user in JSF

Posted By:   Peter_Januarius  
Posted On:   Thursday, May 17, 2007 07:42 AM


You should be able to register an actionListener on your command link and get the id in the corresponding event:







Then in your method:



public void someMethod(ActionEvent evt){

String componentID = evt.getComponent().getId();
}


"componentID" should be "theID" ie. the link that was clicked.




Cheers...




Pete...

Re: how can i know which link has been clicked by user in JSF

Posted By:   Anonymous  
Posted On:   Wednesday, May 16, 2007 11:06 AM

Hi,

I'm also stuck with the same exact problem. Can any1 assist?

Thanks.
Cpwere
About | Sitemap | Contact