[Zope] how to request a multiple select list?

Juergen R. Plasser / HEXAGON plasser@hexagon.at
Tue, 22 Jan 2002 16:51:03 +0100


Hi,

I am almost new to Zope and HTML-Forms, so I have run into some 
difficulties.

I have just a problem with a lines property of an object that should be 
edited. I use a form with hidden fields (for the lines property of the 
object there is a <input name="abc" type="hidden" values="<dtml-var 
user_list>">).

When the user now clicks the edit button the action (let's call it 
action_html) should be executed. In action_html I'd like to show the user 
the current values (for the list it must be a multiple select) and give 
him/her the chance to change the properties.

But how can I request the list from the previous form? I always get a list 
including one string (which is a list itself), like this 
["['user1','user2','user3']"].

How can I simply forward the variable/value from the one form to the other? 
Or is it possible to request the object properties from the given id?

Besides that, is there a simple solution to select the given list values in 
a multiple select tag? I have a workaround that looks like this:

<SELECT name="newBenutzerliste:list" size="8" width="16" multiple>
 <dtml-in get_valid_userids>
  <dtml-let seqi=sequence-item>
    <dtml-call "REQUEST.set('sel',0)">
    <dtml-in Benutzerliste>
      <dtml-if expr="_['seqi']==_['sequence-item']">
        <OPTION selected value="<dtml-var sequence-item 
html_quote>"><dtml-var sequence-item></OPTION>
        <dtml-call "REQUEST.set('sel',1)">
      </dtml-if>
   </dtml-in>
   <dtml-if sel>
   <dtml-else>
        <OPTION value="<dtml-var sequence-item html_quote>"><dtml-var 
sequence-item></OPTION>
   </dtml-if>
  </dtml-let>
 </dtml-in>
</SELECT>

Juergen