on 01-30-2004 3:17 PM
A quickie. Is it possible to set a bean value in JavaScript. Cause I sure am trying to but no luck. Basically what i am trying to do is that when the user clicks a button on the jsp iview a popup appears. Now since there is more than one button in the jsp view i wish to set a state in the bean depending on which button was clicked and trap that in the doprocessbeforeoutput in the .java file. Thanks.
No it is not possible. JSP scriptlets (contained within <% %> brackets) are executed at the server whereas javascripts are executed at the client. That means that the expression mySelectBean.setState(DEFAULT_STATE); will be executed before the response is sent to the client and not when the client execute the javascript function tester().
Hope this makes it a little clearer.
In general you may not manipulate the state of objects contained in the webserver (s.a. beans) in javascript functions.
Regards
/Fredrik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.