Thanks for the reply. I will move to Tapestry 4 soon
but for now I need to implement in Tapestry 3.

I have placed the Delegator component after the
PropertySelection component within the TD tag. I don't
understand how MyDelegate accesses the component that
it needs to validate. Here is what I have so far:
<pre>
<td>
   <select jwcid="[EMAIL PROTECTED]"
model="ognl:colors" value="ognl:color"></select>
   <span jwcid="@Delegator"
delegate="ognl:myDelegate"/>
</td> 

public class MyDelegate implements IRender {

   public void render(IMarkupWriter w, IRequestCycle
c) {
      if (c.isRewinding()) {
         // validate component
         // - if user selected red then print "***" 
      }
   }

}  

Home.java has a getMyDelegate method.
</pre>

1. How does the render method get access to the
component it needs to valid to validate?
2. If I am in rewind then how does the *** ever get
printed in case of error since output is swallowed.

I am currently digging thru the source for
ValidationDelegate for clues as well as looking thru
Tapestry in Action and EnjoyWebDevWithTapestry.

Thank you very much,
Larry Sherrill



--- Kent Tong <[EMAIL PROTECTED]> wrote:

> Larry Sherrill <larrypsherrill <at> yahoo.com>
> writes:
> 
> > In my submit method I loop through the list of
> Persons
> > to validate that the favoriteColor is not the
> choice
> > "Red". If it is, then I want to mark the
> corresponding
> > propertySelection field with a "**" to the right
> of
> > the PropertySelection drop down.
> 
> The cleanest solution is to upgrade to Tapestry 4
> where
> you can provide a validator to validate your
> PropertySelection
> component. 
> 
> If you must stick to tapestry 3, you may add a
> Delegator component
> just after your PropertySelection, implement IRender
> in code.
> In that code you can perform the check if it's a
> rewind.
> 
> --
> Author of a book for learning Tapestry
> (http://www.agileskills2.org/EWDT)
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 



                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to