[Zope] Re: Multiple Selection with "Checkboxes":
Dieter Maurer
dieter@handshake.de
Wed, 25 Jul 2001 19:40:11 +0200 (CEST)
I restricted your address list.
You have been a bit generous with the distribution.
Richard Bendit writes:
> What i use is:
>
> 1. UpdateForm (DTML-Method)
> 2. List_available_items (ZSQL-Method)
> "select ap_id,ap_docname from AliasPages where proj_id=<dtml-sqlvar
> proj_id type=int>"
> 3. List_selected_items (ZSQL-Method)
> "select ap_selection from Projects where proj_id=<dtml-sqlvar proj_id
> type=int>"
>
> Problem: I want that the Checkboxes are "CHECKED" if "available_items" ==
> "selected_items"
>
> I am not sure if my dtml is wrong or the sql-method:!
> ....
> <dtml-in List_available_items>
> <input type=checkbox name=ap_selection:list value="<dtml-var
> sequence-item>"
The value specifies what value is send to the server if the
checkbox is checked and the containing form submitted.
"List_available_items" returns (effectively) a sequence of
rows. This means "sequence-item" above is bound to such
a row. It is a bad value. It will
arrive as something like '<Record instance at XXXX>' at the server.
I am sure, you do not want this.
> <dtml-call expr="REQUEST.set(selectedAP,_['sequence-item'])">
> <dtml-in List_selected_items>
> <dtml-if expr="_['sequence-item'] == selectedITEMS">
> checked
> </dtml-if>>
Again: "List_selected_items" returns a list of rows.
A row is not equal to a list...
Dieter