aspose file tools*
The moose likes JSP and the fly likes onClick function call with a scriptlet parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "onClick function call with a scriptlet parameter" Watch "onClick function call with a scriptlet parameter" New topic
Author

onClick function call with a scriptlet parameter

Murad Iqbal
Ranch Hand

Joined: Dec 09, 2003
Posts: 90
Hi all,

Is this a valid function call from nclick?

nClick="editGroup('(less than sign, percentage sign)obGroupBeanArray[i].getRoleId(percentage sign, greater than sign)');"

I have attached this nclick function to an image. I havent tested it with my servlet yet, but I guess we can pass a parameter to a function that is called by nclick. The parameter can be a scriptlet or not, this is what I need to know. It would be either the above way or

nClick="editGroup('(lesser than sign, percentage sign)=obGroupBeanArray[i].getRoleId(percentage sign, greater than sign)');"

this way. Am I wrong?

This page is not taking the correct came of the nclick method, therefore i have trimmed the 'o' from the beginning to get it posted anyhow.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Repeat (this comes up only about several times a week) after me: Javascript can not execute scriptlet code in real time, scriptlet code is executed on the server before the client gets the page and javascript on the client after the client gets the page.

Scriptlet code CAN generate Javascript, bu Javascript can NOT order scriptlet code to execute.

You CAN create Javascript that calls another servlet or JSP and does something with its output but that's not what you're trying to do.


42
Murad Iqbal
Ranch Hand

Joined: Dec 09, 2003
Posts: 90
Is there a solution to this problem?
Murad Iqbal
Ranch Hand

Joined: Dec 09, 2003
Posts: 90
I mean, how can I call a function passing it a parameter? The parameter is not fixed as there are array of buttons on which i will be putting the on-click function. The values inside the called method are taken from a VO passed by servlet.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: onClick function call with a scriptlet parameter