Using attribute property in action element
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ashok_Shankarnarayan
Posted On:   Friday, May 23, 2003 08:40 AM

In one of his previous responses, Ted suggests using the attribute property in action element. Let's say I have an ActionForm, say BaseForm, with several properties. And Form1 and Form2 are subclasses of BaseForm that override the validate() method to validate different sets of properties. So I tried something like this, but didn't work An example of proper usage would be helpful. My objective is to avoid using conditionals within validate() method to validate sets of properties based on which page is currently being processed. Thanks    More>>

In one of his previous responses, Ted suggests using the attribute property in action element.

Let's say I have an ActionForm, say BaseForm, with several properties. And Form1 and Form2 are subclasses of BaseForm that override the validate() method to validate different sets of properties.


So I tried something like this, but didn't work











An example of proper usage would be helpful.


My objective is to avoid using conditionals within validate() method to validate sets of properties based on which page is currently being processed.


Thanks

   <<Less

Re: Using attribute property in action element

Posted By:   Christopher_Schultz  
Posted On:   Friday, May 23, 2003 10:56 AM

Why not have different subclasses (which it looks like you have) that validate in different ways, used separately in each action?



Just do this:











-chris
About | Sitemap | Contact