Ah thanks for the reply - that does sound like a good way to do this.
I guess I was hoping there would be a general way to do something like
this even for other fields (for example, if I later wanted to add a
field for a captcha, which would again have no corresponding field in
the model).  It just seems like this is so close to working and the
other thread I linked to led me to believe that it is working - I just
can't quite figure out how.  If someone can confirm for me though that
currently there is no support for having fields in the view that do
not match fields in the model in the type of use case that I describe,
that would be great - otherwise I will probably just try to look
through the weblocks code.

On Feb 22, 6:39 pm, Benjamin Collins <[email protected]> wrote:
> On Feb 22, 4:44 pm, Saikat Chakrabarti <[email protected]> wrote:
>
> > I am trying to create a user registration form that has a "Retype
> > Password" field in the view (which does not map to the model's slot).
>
> > [snip]
>
> > So my question is - is what I am trying to do even possible?
> > How should I handle a virtual view field when trying to create a new
> > user?
>
> I think my approach would be to write a custom presentation for a
> password repeat.  If you look in the weblocks sources, you'll see the
> password presentation at
>
> ~/src/views/types/password.lisp
>
> You could render both input fields, use javascript to check that they
> match, and allow it to map to the single slot of the underlying
> object.  I have in mind that you'd have something like this as a view:
>
> (defview login-view (:type form :inherit-from '(:scaffold login-
> widget))
>   (password :present-as confirmed-password))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to