Re: PicoLisp 3.0 GUI changes issue

2009-11-02 Thread Henrik Sarvell
I'll replace them with tw_pwd and tw_uname which is the names of the
E/R relations, I like it consistent over the whole board :-)

/Henrik

On Mon, Nov 2, 2009 at 8:33 AM, Alexander Burger a...@software-lab.de wrot=
e:
 Hi Henrik,

 As of PicoLisp 3 *Post for instance is no more so the above wouldn't

 That's right. Just for the info, '*Post' needs to be replaced by '*PRG'.
 In the code in we discussed, however, it was not necessary any more.


 I'm unable to get the cursor to appear in them. The only lead I have
 on this one is that the pwd2 field is of course the only field that is
 not a part of the +User E/R.

 Oops, my error. '+E/R' does not make sense in _all_ fields, as the
 object is no longer created at the initial GET, but in the Save
 button. '+E/R' automatically disables input fields when the form holds
 no object.

 So the solution should be (not tested):

 (de register ()
 =A0 (app)
 =A0 (action
 =A0 =A0 =A0(rss-html
 =A0 =A0 =A0 =A0 (form NIL
 =A0 =A0 =A0 =A0 =A0 =A0(grid 2
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Username (gui 'uname '(+AlNum) 10)
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Password (gui 'pwd '(+PwdCheck +PwField) '(=
val (: home pwd2)) 10)
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Password Again (gui 'pwd2 '(+PwField) 10)
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Email (gui 'email '(+TextField) 10)
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Twitter username (gui 'twn '(+TextField) 10=
)
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Twitter password (gui 'twp '(+PwField) 10) =
)
 =A0 =A0 =A0 =A0 =A0 =A0(gui '(+Button) Save
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 '(cond
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ((db 'uname '+User (val (: home unam=
e)))
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(err Name not unique) )
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (( (val (: home pwd)) (val (: hom=
e pwd2)))
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(err Password mismatch) )
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (T
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(let Usr
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (new! '(+User)
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'uname (val (: ho=
me uname))
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'tw_pwd (val (: h=
ome tw_pwd))
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'tw_uname (val (:=
 home tw_uname))
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'pwd (val (: home=
 pwd))
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'email (val (: ho=
me email)))
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (cookie 'uid (put! Usr '=
uid (randNum '+Gh 20)))
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (redir) ) ) ) ) ) ) ) )

 The two fields 'twn' and 'twp' are not used?

 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe

-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


PicoLisp 3.0 GUI changes issue

2009-11-01 Thread Henrik Sarvell
Hi Alex I can't remember if we had this discussion on IRC or on the
list. I'll do a short recap in case it was IRC.

The main thing is that my old registration form looked like this:

(de register ()
   (app)
   (action
  (rss-html
 (form NIL
(unless *Post (=: obj (new! '(+User
(table NIL NIL NIL
   (row NIL Username  (gui '(+E/R +AlNum) '(uname :
home obj) 10))
   (row NIL Password
  (gui
 '(+E/R +PwdCheck +PwField)
 '(pwd : home obj)
 '(val (: home pwd2)) 10))
   (row NIL Password Again (gui 'pwd2 '(+PwField) 10 ))
   (row NIL Email (gui '(+E/R +TextField) '(email :
home obj) 10))
   (row NIL Twitter username (gui '(+E/R +TextField)
'(tw_uname : home obj) 10))
   (row NIL Twitter password (gui '(+E/R +PwField)
'(tw_pwd : home obj) 10))
   (row NIL (gui '(+Button) Save
 '(let Usr (: home obj)
 (cookie 'uid (put! Usr 'uid
(randNum '+Gh 20)))
 (redir)

As of PicoLisp 3 *Post for instance is no more so the above wouldn't
work, the result was a reworked proposal for the form by Alex which I
subsequently filled in the gaps in (ie cookie, redirect etc). The
result is here:

(de register ()
   (app)
   (action
  (rss-html
 (form NIL
(grid 2
   Username (gui 'uname '(+E/R +AlNum) '(uname : home obj) 10)
   Password
   (gui 'pwd '(+E/R +PwdCheck +PwField)
  '(pwd : home obj)
  '(val (: home pwd2)) 10)
   Password Again (gui 'pwd2 '(+PwField) 10 )
   Email (gui 'email '(+E/R +TextField) '(email : home obj) 10)
   Twitter username (gui 'twn '(+E/R +TextField)
'(tw_uname : home obj) 10)
   Twitter password (gui 'twp '(+E/R +PwField) '(tw_pwd
: home obj) 10) )
(gui '(+Button) Save
   '(cond
   ((db 'uname '+User (val (: home uname)))
  (err Name not unique) )
   (( (val (: home pwd)) (val (: home pwd2)))
  (err Password mismatch) )
   (T
  (let Usr
 (new! '(+User)
'uname (val (: home uname))
'tw_pwd (val (: home tw_pwd))
'tw_uname (val (: home tw_uname))
'pwd (val (: home pwd))
'email (val (: home email)))
 (cookie 'uid (put! Usr 'uid (randNum '+Gh 20)))
 (redir)

The problem with this form is that only the pwd2 field is able to
receive any kind of attention, the others are completely shut down,
I'm unable to get the cursor to appear in them. The only lead I have
on this one is that the pwd2 field is of course the only field that is
not a part of the +User E/R.

I'm using FF 3.5.3, any ideas what the problem might be?

/Henrik
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: PicoLisp 3.0 GUI changes issue

2009-11-01 Thread Alexander Burger
Hi Henrik,

 As of PicoLisp 3 *Post for instance is no more so the above wouldn't

That's right. Just for the info, '*Post' needs to be replaced by '*PRG'.
In the code in we discussed, however, it was not necessary any more.


 I'm unable to get the cursor to appear in them. The only lead I have
 on this one is that the pwd2 field is of course the only field that is
 not a part of the +User E/R.

Oops, my error. '+E/R' does not make sense in _all_ fields, as the
object is no longer created at the initial GET, but in the Save
button. '+E/R' automatically disables input fields when the form holds
no object.

So the solution should be (not tested):

(de register ()
   (app)
   (action
  (rss-html
 (form NIL
(grid 2
   Username (gui 'uname '(+AlNum) 10)
   Password (gui 'pwd '(+PwdCheck +PwField) '(val (: home pwd2)) 
10)
   Password Again (gui 'pwd2 '(+PwField) 10)
   Email (gui 'email '(+TextField) 10)
   Twitter username (gui 'twn '(+TextField) 10)
   Twitter password (gui 'twp '(+PwField) 10) )
(gui '(+Button) Save
   '(cond
   ((db 'uname '+User (val (: home uname)))
  (err Name not unique) )
   (( (val (: home pwd)) (val (: home pwd2)))
  (err Password mismatch) )
   (T
  (let Usr
 (new! '(+User)
'uname (val (: home uname))
'tw_pwd (val (: home tw_pwd))
'tw_uname (val (: home tw_uname))
'pwd (val (: home pwd))
'email (val (: home email)))
 (cookie 'uid (put! Usr 'uid (randNum '+Gh 20)))
 (redir) ) ) ) ) ) ) ) )

The two fields 'twn' and 'twp' are not used?

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe