This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

eventHandler in struts

 
fab etore
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
fab etore
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is done.
Sorry.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18155
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic