• 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
  • Tim Cooke
  • Ron McLeod
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Programmatically Fire a Change Event Using JSTL

 
Ranch Hand
Posts: 2291
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use JSTL to auto populate a select list. During the for each loop I check for a match on the var attribute.
If a match is detected I set the selected attribute on the option.
If there a way at the same time to fire the change event?

 
Saloon Keeper
Posts: 28997
214
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not exactly sure I understand, but JSTL is not an executable language. It's a declaration language.

In other words, a "forEach" doesn't execute on the client. It's used to generate static HTML when the server converts the JSP page template to the output HTML stream (web page). So you cannot fire an event on the client, since the page hasn't even been sent to the client yet.

On the other hand, since you're still running in the server, you don't need all that stuff. Just set the info as part of your server session state.
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic