it would be really useful to generalise <dtml-in var> to allow for the case when the variable is a singleton. I know I can write testing code for this, but it's a real pain to find that multiple selections change type when only one item is selected. -- Robin Becker
On Sun, 29 Aug 1999, Robin Becker wrote:
it would be really useful to generalise <dtml-in var> to allow for the case when the variable is a singleton. I know I can write testing code for this, but it's a real pain to find that multiple selections change type when only one item is selected. Well, what about, the following trick: <dtml-unless "testvar[0:0]==[]"> <dtml-call "REQUEST.set('testvar',[testvar])"> </dtml-unless>
Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +43/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
In article <Pine.LNX.4.10.9908291941250.8111-100000@gatekeeper.zwax.mtg. co.at>, Andreas Kostyrka <andreas@mtg.co.at> writes
On Sun, 29 Aug 1999, Robin Becker wrote:
it would be really useful to generalise <dtml-in var> to allow for the case when the variable is a singleton. I know I can write testing code for this, but it's a real pain to find that multiple selections change type when only one item is selected. Well, what about, the following trick: <dtml-unless "testvar[0:0]==[]"> <dtml-call "REQUEST.set('testvar',[testvar])"> </dtml-unless> ... I know how to do the fix; it's just a pain. -- Robin Becker
At 18:36 29/08/99 , Robin Becker wrote:
it would be really useful to generalise <dtml-in var> to allow for the case when the variable is a singleton. I know I can write testing code for this, but it's a real pain to find that multiple selections change type when only one item is selected.
If you add :list to the form variable, it will always be a list, wether or not it is a singleton: <SELECT NAME="items:list" MULTIPLE SIZE=5> ....</SELECT> and in the receiving DTML: <dtml-in items> </dtml-in> -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
In article <4.2.0.58.19990830085237.045c7ea0@lisp.atmm.nl>, Martijn Pieters <mj@antraciet.nl> writes
At 18:36 29/08/99 , Robin Becker wrote:
it would be really useful to generalise <dtml-in var> to allow for the case when the variable is a singleton. I know I can write testing code for this, but it's a real pain to find that multiple selections change type when only one item is selected.
If you add :list to the form variable, it will always be a list, wether or not it is a singleton:
<SELECT NAME="items:list" MULTIPLE SIZE=5> ....</SELECT>
and in the receiving DTML:
<dtml-in items> </dtml-in> ... that's nicer; thanks -- Robin Becker
participants (3)
-
Andreas Kostyrka -
Martijn Pieters -
Robin Becker