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