aspose file tools
The moose likes Struts and the fly likes Scriplet in Select Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Scriplet in Select" Watch "Scriplet in Select" New topic
Author

Scriplet in Select

santosh jaha
Greenhorn

Joined: Aug 17, 2004
Posts: 3
When i write a scriplet in the JS method call of onChange of html:Select tag, the scrolet does not get converted to value...
Any idea why this is happeneng.....
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4115
    
    2

Post the code so we can see what you're actually doing. Thanks


Junilu - [How to Ask Questions] [How to Answer Questions] [MiH]
santosh jaha
Greenhorn

Joined: Aug 17, 2004
Posts: 3
Well I have written the struts tag as
<html:select property="strCategory" onChange="set('NewQuestionForm','<%=CommonConstantsIF.ACTION_GET_PAGES%>')">

when i run the application, and see the source of generated web-page i see
<select name="strCategory" onchange="set('NewQuestionForm', '<%=CommonConstantsIF.ACTION_GET_PAGES%>')">

Here the Scriplet doen't get converted to resulting string....
Shankar Narayana
Ranch Hand

Joined: Jan 08, 2003
Posts: 134
Yes I do have the same problem , it happens only when the scriptlet is inside the javascript method.


"Failure is not when you fall down; its only when you fail to get up again."
santosh jaha
Greenhorn

Joined: Aug 17, 2004
Posts: 3
Got one solution.....
Create a string for method call... like this

<%String strAction="javascript:set('NewQuestionForm','" + CommonConstantsIF.ACTION_GET_PAGES + "')"; %>

and then put this string in place of method call of onChnage

<html:select property="strCategory" onChange="<%=strAction%>">

It works..........
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Scriplet in Select
 
Similar Threads
can we use java object in java script
Can we use Threads in a Scriplet
i need help with css to achieve a whitespace
jsp:useBean clarification please
returning an array from servlet responce