Hi Alex,

> Regarding that, here's a modified version of your '+Radio' class:

that is neat:-)

> I can be called like this:
>
>    (gui '(+Radio) NIL "value1a")
>    (gui '(+Radio) -1 "value1b")
>    (gui '(+Radio) -2 "value1c")
>    ...
>    (gui '(+Radio) NIL "value2a")
>    (gui '(+Radio) -1 "value2b")
>    (gui '(+Radio) -2 "value2c")
>
> With aliases for the group leaders, the above example would be:
>
>    (gui 'group1 '(+Radio) NIL "value1a")
>    (gui '(+Radio) 'group1 "value1b")
>    (gui '(+Radio) 'group1 "value1c")
>    ...
>    (gui 'group2 '(+Radio) NIL "value2a")
>    (gui '(+Radio) 'group2 "value2b")
>    (gui '(+Radio) 'group2 "value2c")

(I am worried that the second way with aliases would not work well
with charts?)

The only objection I have now is that specifying the radio buttons is
not regular enough, i.e. I (as the application programmer) have to
know up-front which button is the first one in the group and create it
differently from the rest. It would be better if I could just call:

(gui '(+Radio) 'group1 "value1a")
(gui '(+Radio) 'group1 "value1b")
(gui '(+Radio) 'group1 "value1c")
..
(gui '(+Radio) 'group2 "value2a")
(gui '(+Radio) 'group2 "value2b")
(gui '(+Radio) 'group2 "value2c")

Imagine the following scenario: An admin user can enter an enrolment
form using a simple wiki-like markup text. The form can contain
checkboxes, radiobuttons, etc. When a user decides to enrol, she fills
in the form which is then saved into the database.  The admin user can
then generate reports displaying the information entered by users for
a particular event.

In such scenario, I do not know up-front what is going to be in the
form. I have to write a piece of code which finds out which radio
button is the first one.  I thing this piece of code should be part of
the +Radio code.

> You could store it in a property 'radio' in the form (e.g. *Top). In
> this way it will be empty for a new form, and will be found and
> reused when a form is reloaded during a POST event.

This seems like a good idea to avoid *Radio and keep the usage
uniform.

> One downer remains, though: As I suspected, "lib/form.js" does not work
> with radio buttons. I'll have to check that separately.

I have javascript disabled in my browser and I haven't looked at how
picolisp handles browser side.  I hope there won't be any major
obstacle.

Thanks,

Tomas
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]

Reply via email to