[Zope] Filling Multiple Select Problem
Cesar A. K. Grossmann
cesar@rotnet.com.br
Wed, 25 Oct 2000 20:50:36 -0200
Hi!
I'm using the example at the "Filling MULTIPLE SELECT OPTION's with
database lists", and a little step doesn't works.
I heve the following in the DTML Method that fills two SELECT in a Web
Form:
(...)
<dtml-call "REQUEST.set('cadExportacao', [])">
<dtml-call "REQUEST.set('cadImportacao', [])">
<dtml-in sqlVinculacao>
<dtml-if "tipo=='E'">
<dtml-call "cadExportacao.append(codigo)">
<dtml-elif "tipo=='I'">
<dtml-call "cadImportacao.append(codigo)">
</dtml-if>
</dtml-in sqlVinculacao>
(...)
The code above runs. To verify that, I put a <dtml-var cadExportacao>
and a <dtml-var cadImportacao>, that prints the contents of the lists
above.
The code that is not running is the one bellow:
<SELECT NAME="exportadores" MULTIPLE SIZE="10" WIDTH="300">
<dtml-in sqlCadastroExportacao>
<OPTION
VALUE="<dtml-var codigo>"
<dtml-if "codigo in cadExportacao">SELECTED </dtml-if>
>
<dtml-var nome>
</OPTION>
</dtml-in sqlCadastroExportacao>
</SELECT>
(...)
The code above creates a SELECT list like the one bellow:
<SELECT ...>
<OPTION VALUE="1">NOME 1</OPTION>
<OPTION VALUE="2">NOME 2</OPTION>
<OPTION VALUE="3">NOME 3</OPTION>
(...)
</SELECT>
but the <dtml-if "codigo in cadExportacao"> part doesn't function. I
have some of the values of "codigo" in the cadExportacao list, but the
"SELECTED" corresponding code doesn't appears.
Can someone tells me what is wrong?
Sorry the bad english...
[]s
--
+---------------------------------+---------------------------------+
| César A. K. Grossmann | Capacitação Solidária |
| ckant@fazenda.gov.br | http://www.uol.com.br/umminuto/ |
| http://members.xoom.com/ckant/ | Clique e doe - é de graça |
+---------------------------------+---------------------------------+
http://www.halcyon.com/sciclub/cgi-pvt/instr/instr.html
Any member introducing a dog into the Society's premises shall be
liable to a fine of one pound. Any animal leading a blind person shall
be deemed to be a cat.
-- Rule 46, Oxford Union Society, London