Thank you Mattias and Alex.  Mattias, your reminder of using +Var like in
the tutorial when there isn't necessarily a db object yet was helpful.

Alex, I still can't seem to get idForm to work even after looking at it in
form.l    Do I need something like:

(get (default *ID (val *DB)) 'nm)

like in family.l?  Can you please provide a small example of how to use
idForm to create a new database object?  I feel the need to understand.
Thank you again for all the speedy help.

-David Bloom



On Tue, Jun 14, 2016 at 1:35 AM, Alexander Burger <a...@software-lab.de>
wrote:

> Hi David, Mattias,
>
> > but the +TextField's use +E/R, which connects GUI components to database
> > objects. If I am not mistaken, +E/R uses a locking mechanism to stop
> > several users from changing objects at the same time. Usually, there is
> an
> > (editButton) involved to allow a user to lock the object, make
> > modifications and release the lock once the modifications are done. You
> can
> > find examples of this in the demo app shipped with the PicoLisp
> > distribution.
> >
> > Try changing these lines:
> >
> > (gui '(+E/R +TextField) '(name : home obj) 40 "Name")
> > (gui '(+E/R +TextField) '(email : home obj) 40 "Email")
> >
> > To this:
> >
> > (gui '(+Var +TextField) '*Name 40 "Name")
> > (gui '(+Var +TextField) '*EMail 40 "Email")
> >
> > This uses a '+Var' prefix class to connect the gui components to a
> variable
> > instead. This variable is used by (newButton) to create a new object.
>
> This is correct.
>
> When, however, David wants to edit DB objects, then the +E/R prefix is
> right. But then the 'form' needs an object to be enabled.
>
> The key is to call the 'idObj' function in the form. Usually this is
> done in a header like
>
>    (<h2> NIL (<id> (: nm)))
>
> '<id>' internally call 'idObj' which takes care of handling the DB
> objects. Another - more standard - way is to use 'idForm'
>
>    (menu ,"Title"
>       (idForm ,"Title" '(chocls) 'nr '+cls T '(may Delete) '((: nr) " -- "
> (: name))
>          ... ) )
>
> ♪♫ Alex
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>

Reply via email to