I have a table displaying the following columns: item_id, title, last_scanned, updates, and feed_url (item_id being a checkbox).
I build the form:
db_multirow sources sources { *SQL* }
ad_form -name delete_subscription -form {
{source_id:text(checkbox) {label ""} }
{delete_submit:text(submit) {label "Unsubscribe" } }
}
And display it:
<table cellspacing=1 cellpadding=5 border=0 width="100%">
<formtemplate id="delete_subscription">
<multiple name="sources">
<tr bgcolor="#ffffff">
<td><formwidget id="source_id"></td>
<td><a href="@sources.link@" title="@sources.description@">@sources.title@</a></td>
<td>@sources.last_scanned@</td>
<td>@sources.updates@</td>
<td><a href="@sources.feed_url@"><img src="@xml_graphic_url@" width="36" height="14" border="0" \
alt="Click to view the current XML source text for the channel." title="Click to view the current XML source t\
ext for the channel." /></a></td>
</tr>
</multiple>
</formtemplate>
</table>
Of course, since I didn't specify any values for the checkbox element, it is displayed as follows:
<input type="checkbox" name="source_id" />
Had I only been displaying a multirow datasource, I would've used
<multiple>
. Had I only been displaying a form, I would've used
<formgroup>
. So I need a way to display checkboxes and a multirow datasource alongside. The way I see it there are two ways of doing this. Either by building a widget that accepts a multirow datasource and turns it into a table with nice checkboxes or something along the lines of:
<formwidget id="source_id" value="@sources.source_id@">
to make the checkbox values coincide with multirow datasource.
Or perhaps someone have already done this?
/Simon