[ZWeb] Highliting data from multiple selection list

Christian Theune ct@gocept.com
Thu, 7 Mar 2002 07:53:41 +0100


Hi.

On Wed, Mar 06, 2002 at 04:53:42PM -0700, Mike Tran wrote:
> I've tried the  split method but it did not  worked and I get an "object has 
> no attribute 'split' " error if agency_selected is blank. So, how do i turn a 
> string into a list?
> 
> Here's my <dtml-var agency_selected>:
> 
> ['Agua Caliente Gaming Commission Spa Casino', 'Barona Band of the Capitan 
> Grande of Diegueno Miss', 'Bay Mills Indian Community Gaming Commission']
> 
> Thanks,
> 
> 

Well if agency_selected already _is_ a List then you only should switch
the parameters of the "in" statement:

    agency_name in agency_selected
    (element	in  list)

If you need to split it, and have a problem with empty Values try:
    _.string.split(agency_selected, ",")
which returns an empty list if agency_selected is an empty string.

Greetings

Christian

-- 
Christian Theune - ct@gocept.com
gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt
tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981

reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b'])