Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scriplet in Select

 
santosh jaha
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 7758
62
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post the code so we can see what you're actually doing. Thanks
 
santosh jaha
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I do have the same problem , it happens only when the scriptlet is inside the javascript method.
 
santosh jaha
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..........
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic