[Zope] Problem with dtml-if sequence-start (solved)

Borja Prieto borja.prieto@alanta.info
Mon, 4 Aug 2003 10:44:31 +0200


Dear Dylan

Thank you for your help. It works all right now.
Best regards

Borja Prieto
Alanta

> -----Mensaje original-----
> De: zope-admin@zope.org [mailto:zope-admin@zope.org]En nombre de Dylan
> Reinhardt
> Enviado el: lunes, 04 de agosto de 2003 6:05
> Para: Borja Prieto
> CC: zope@zope.org
> Asunto: RE: [Zope] Problem with dtml-if sequence-start
>
>
> On Sun, 2003-08-03 at 16:14, Borja Prieto wrote:
> > Here is my code now:
> >
> > <dtml-unless txtCertificado>
> >     <dtml-call
> "RESPONSE.redirect(URL1+'/InicioIC'+'?msg_error=Error: debe
> > introducir un número de certificado')">
> > </dtml-unless>
> > <dtml-in BuscaCertificado>
> >      <dtml-if sequence-start>
> >          <dtml-call
> "RESPONSE.redirect(URL1+'/InicioIC'+'?msg_error=Error:
> > el certificado '+txtCertificado+' ya existe')">
> >      </dtml-if sequence-start>
> >      <dtml-call
> > "RESPONSE.redirect(URL1+'/IC'+'?txtCertificado='+txtCertificado)">
> > </dtml-in>
> [snip]
> > But when it finds the third case (there is a value for
> txtCertificado, and
> > it is not already in the database) it does nothing.
>
> That's because there is no possible case where the third dtml-call will
> ever be invoked.  If BuscaCertificado is empty (no records found),
> there's nothing for dtml-in to loop over.  Control passes to the next
> line after </dtml-in>.  Since there is nothing after that tag, your
> return is a blank screen... or more accurately, a screen full of
> non-rendering whitespace.
>
> Try something like this instead:
>
> <dtml-if txtCertificado>
>    <dtml-if BuscaCertificado>
>       <dtml-call "RESPONSE.redirect('http://url_1')">
>    <dtml-else>
>       <dtml-call "RESPONSE.redirect('http://url_2')">
>    </dtml-if>
> <dtml-else>
>    <dtml-call "RESPONSE.redirect('http://error_url')">
> </dtml-if>
>
> HTH,
>
> Dylan
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>