>
>  You need some Javascript to change the dropdown choices when one of
>> the radio buttons is clicked.
>>
>> Does that help?
>>
>> Perhaps nunb can add his two cents too.
>>
>
> Thanks. I was just wondering whether there is any built-in form widget
> option that will allow the input of one field affecting another input field.
>
>


In the interim I've been writing the custom-2c-radio-presentation.. ;-)

The easy way to propagate changes between the radio and the dropdown is to
mark the form dirty, and have presentation-choices calculated afresh for the
dropdown. The problem is that pretty much all input fields etc. get reset to
blanks. A simple onchange applied per-field (Saikat's extant work) would
make this route feasible, by storing updated form values in
intermediate-values.



> Looks like I will need to define my own widget to do that.
>
>

This would be much easier if field presentations were themselves widgets,
and there is some momentum towards that..

Depending on how much of the logic you want to keep in lisp (is having it
inside parenscript close enough?) and how tightly coupled the radio
presentation and the dropdown should be, I guess a presentation to do that
could be arranged. Also, it's a common use-case (the other use-case is
hiding and showing divs) and so should be baked in..

What about another option, having two dropdowns in your form, and
selectively hiding them? Custom writers could be used if you want to update
a common slot.

The problem with this is that if you write your logic CL-side, there's going
to be a delay (and the ajax-call gif display) before the dropdown values are
switched. If it were done totally through javascript, this delay would not
exist. Furthermore, UX wise it's good to animate the change, and the current
Weblocks update mechanism doesn't allow for animation hooks

-- 
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