Message2584
Here is a macro definition that provides the hidden input needed to allow users to unselect all options in a multi-select:
<metal:macro define-macro="multiselect">
<select metal:define-slot="select"
tal:define="height height | size | default;"
tal:replace="structure python:context[name].menu(height=height)">
</select>
<input type="hidden" value="" tal:attributes="name name;" />
</metal:macro>
Here is a snippet from issue.item.html which uses the macro to create a multi-select for issue keywords:
<tr tal:define="height string:5;">
<th>Topics</th>
<td tal:define="name string:topics;">
<metal:macro use-macro="templates/page/macros/multiselect" />
</td>
</tr>
This assumes that the macro definition is placed in page.html, and sets the height of the selection box to be 5 items high. Hope that helps! |
|
Date |
User |
Action |
Args |
2009-02-03 14:22:19 | admin | link | issue2075156 messages |
2009-02-03 14:22:19 | admin | create | |
|