[Zope] Problem on using nested dtml-ifdtml-in

2001-01-16 Thread Spicklemire, Jerry

Angie asked:

 The problems is i'm not sure my dtml in order to control the loop 
 of choosing the correct sql in the right situation.
 The following is my DTML:-
 
 dtml-if "_["dtml-var custid"]==custid","_["dtml-var 
 custname"]==custname"
 dtml-in sqlSearchcust1
 /dtml-if

 dtml-elif "_[""]==custid","_["dtml-var custname"]==custname"
 dtml-in sqlSearchcust2
 /dtml-if

 dtml-elif "_["dtml-var custid"]==custid","_[""]==custname"
 dtml-in sqlSearchcust3
 /dtml-if

First, the rule is "No DTML inside DTML", which translates to 
simply refering to objects by names, in any DTML tag, like so:

dtml-if "_['custid']==custid,_['custname']==custname"

Also, notice that the only Double-Quotes are the outside pair, 
inside those you must use single quotes.

Last, the only DTML-IF tag you need is that final one.

Try this much, and see if all your probems go away.
If not, let us know.

Later,
Jery S.



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Problem on using nested dtml-ifdtml-in

2001-01-12 Thread angie tel

I have been created the 4 different sql method,
the first is

sqlSearchcust1:
select * from customer where custid=dtml-sqlvar custid type=string
AND
custname=dtml-sqlvar custname type=string

//This method will be call when i have to enter both exactly similar to 
custid and custname in order to search the record.

second is
sqlSearchcust2:
select * from customer where  custid=""
AND
custname LIKE "%dtml-var custname%"

//This method will be call when i only enter the few words to search the 
custname of the records.

third is
sqlSearchcust3:
select * from customer where custid=dtml-sqlvar custid type=string
AND
custname=""

//This method will be call when i only enter on custid to search the 
records.

If both empty it will link to another URL to display all the customer 
record.

The problems is i'm not sure my dtml in order to control the loop of 
choosing the correct sql in the right situation.
The following is my DTML:-

dtml-if "_["dtml-var custid"]==custid","_["dtml-var 
custname"]==custname"
dtml-in sqlSearchcust1
/dtml-if

dtml-elif "_[""]==custid","_["dtml-var custname"]==custname"
dtml-in sqlSearchcust2
/dtml-if

dtml-elif "_["dtml-var custid"]==custid","_[""]==custname"
dtml-in sqlSearchcust3
/dtml-if


  Please help me on correct the dtml Thank You!






_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Problem on using nested dtml-ifdtml-in

2001-01-12 Thread Dieter Maurer

angie tel writes:
  ...
  dtml-if ...
dtml-in sql1
  /dtml-if
As you recognized DTML tags must be *properly* nested...

You can do:

  dtml-if ...
dtml-call "REQUEST.set(sql,sql1)"
  /dtml-if
  
  dtml-in sql

  /dtml-in

This way, you get a properly nested DTML structure.


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )