• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Scriplet in Select

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.....
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..........
reply
    Bookmark Topic Watch Topic
  • New Topic