On Wed, 2003-11-26 at 13:29, Jeremy Quinn wrote:
> I would like to add a delete button to each row of a repeater.
> (I do not like the select checkbox method .... )
>
> I have two questions .....
>
> How do I add a warning?
> ie. you click delete on one of the rows and you get asked :
> "Are you sure you want to delete this row? This action cannot be
> undone.: [OK], [Cancel]"
> A client-side javascript would do, but I am not sure what the
> 'official' way of adding this.
By using a wi:styling element with whatever attributes you prefer, and
adding a template that handles it.
For example:
<wt:widget id="mybutton">
<wi:styling show-warning="true">
<message>Are you sure you want to delete this item</message>
</wi:styling>
</wt:widget>
and in your custom XSL (which imports woody-field-styling.xsl):
<xsl:template match="wi:action[wi:[EMAIL PROTECTED]'true']]">
... generate necessary HTML ...
</xsl:template>
At least I think this is the way, I haven't been following the latest
updates to the XSL's.
>
> How do I call delete on my bean?
> I am using Hibernate, it is not enough to just remove the item from
> the Collection, I also need to call session.delete (resource) (or more
> accurately ResourcePeer.delete (session, resource), so it is wrapped in
> a Transaction) on the deletee.
Simply execute this code from an event-handler attached to the button?
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED] [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]