Hmm, that's exactly what I said, no? Kalle
On Thu, Jul 24, 2008 at 11:21 PM, Andreas Andreou <[EMAIL PROTECTED]> wrote: > Wouldn't the encode parameter of > http://tapestry.apache.org/tapestry4.1/components/form/hidden.html > help here? > > On Fri, Jul 25, 2008 at 8:02 AM, Kalle Korhonen > <[EMAIL PROTECTED]> wrote: > > Ah, just answering to myself and for future reference. The form > components > > don't need to do anything special to support client-side validation, but > in > > my case the problem is that Hidden by default uses Datasqueezer to encode > > the value, in practice adding an uppercase S to the beginning of the > value > > and thus causing the compared values to be different. You can use the > hidden > > field approach together with Differ when you turn encoding off on Hidden > > component. Still; the built-in validators require a IFormComponent; at > least > > for Differ it might have made more sense that you could just specify a > value > > instead (but it's simple to implement your own component for this). > > > > Kalle > > > > > > On Thu, Jul 24, 2008 at 12:02 PM, Kalle Korhonen < > [EMAIL PROTECTED]> > > wrote: > > > >> Is it possible to use Differ validator to validate a field shouldn't > match > >> a known value? Match/Differ expects to match against a form component; > just > >> any component won't do. In my case the value the value to differ against > >> cannot change (think use case where a password cannot match with a > >> username). So I just tried making the username a hidden field, then > pointing > >> the differ to that component, but client side validation doesn't work in > >> that case, and the validation is only enforced on the server side (I > guess > >> because Hidden doesn't support client-side validation?). If the > component to > >> differ against is a normal text field, the client validation works ok, > but I > >> don't want a user to be able to change the field to differ against. I > >> suppose I could hide this field from the user or do some other hack to > make > >> it work, but is there a clean way to implement it? > >> > >> Kalle > >> > > > > > > -- > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr > Tapestry / Tacos developer > Open Source / JEE Consulting > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
