aspose file tools*
The moose likes Struts and the fly likes Pass a parameter to an event handler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Pass a parameter to an event handler" Watch "Pass a parameter to an event handler" New topic
Author

Pass a parameter to an event handler

Steve Watson
Ranch Hand

Joined: Apr 08, 2003
Posts: 38
I am trying to pass a bean property value to a JavaScript function through an onclick event handler. The following code works fine (of course on click without a space) with a hard coded value of 1 passed to the function:



But how do I pass the bean parameter which I can get from:



Thanks any help.

[ January 14, 2006: Message edited by: Steve Watson ]
[ January 14, 2006: Message edited by: Steve Watson ]
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
I'm doing this off the top of my head, but something close to the following should work since a page scope attribute named with the id attribute is created by the <logic:iterate> tag:



If you wanted to make your code a little neater, you might try using the <bean:define> tag:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pass a parameter to an event handler