dcsimg
Passing jsp scriplet expression as parameter to javascript function
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aderemi_Adesoji
Posted On:   Monday, March 16, 2009 12:03 PM

Good day,
I will appreciate it, if I can get soltuion to this problem.

I am trying to pass a jsp scriptlet expression to a javascript function,but I don't undersatnd the reason why I keep getting the scriplet expression in my javascript the javascript is called using this format

onblur="javascript:cal_total(this.value,' <%=count%>');".

Each time I execute this javascript I keep having the scriptlet expression.

Re: Passing jsp scriplet expression as parameter to javascript function

Posted By:   praveen_reddy  
Posted On:   Friday, May 1, 2009 09:35 AM



I had a similar problem and I was able to solve this with the work around shown below :

1)Initial JSP tag that did not work for me :

.....




2)Following are steps in the work around I have used to solve the problem:

a)Created a java variable using jsp scriplet and assigned it
complete syntax for invoking java script function 'reloadTatCodes(...)'. 'i' is variable.:

<%

String funName = "javascript:return (reloadTaTCodes('newRequestTestInfoActionForm','testData["+(i-2)+"].testCode','testData["+(i-2)+"].tatCode'))";

%>

b)Reframed JSP tag using variable 'funName' in a jsp expression:


.....



About | Sitemap | Contact