wood burning stoves*
The moose likes Struts and the fly likes eventHandler in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "eventHandler in struts" Watch "eventHandler in struts" New topic
Author

eventHandler in struts

fab etore
Greenhorn

Joined: Jul 01, 2002
Posts: 9
i would like to use methods like setonclick, setonblur, for this sort of <html:text param="toto" name="tintin" />

This events have to be executed by my classe Action.
Exemple, if a girl is connected, the "model" will tell me the sex of the connected person and i will change the vue in fonction of that.
ex: maxlength=6 for a girl and maxlength=20 for a boy (for my field)
So i will call the methods, but i don't see how to implements them.
NB: i'm a beginner, in using struts.
Thanks.
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
fab,
JavaRanch has a naming policy which is strictly enforced. Please read the policy and change your display name if you wish to continue posting here. Thanks.


Matthew Phillips
fab etore
Greenhorn

Joined: Jul 01, 2002
Posts: 9
it is done.
Sorry.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

I think you're making the common error con confusing client-side programmming with server-side programming. "onblur", "onclick", etc. are options to attach client-side (JavaScript) code to the page.
In order to get a server-side action to be performed, you have to do an HTTP submit. This causes whatever form data (or URL-attached data) you specify to be sent to the appserver. If the URL decodes into a Struts request, it will then invoke the associated Action as well as doing any indicated validation/Form Bean operations - all of which are determined in struts-config.xml.
Once the Action has completed, it indicates the next View (JSP) to display, based on the processing that has been done.
Thus, only if you code a JavaScript form submit command (or something similar) in your onClick method can such a client-side operation cause any sort of action down in the Struts server.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: eventHandler in struts
 
Similar Threads
binding, which ethod use?
Fitness equipments anyone??
Only fun forwards for fun ...
Display character for HTML Number
Calling FieldCheck methods from validate() method