cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Hoskens">
Subject REPOST: [woody] enable/disable button
Date Mon, 09 Feb 2004 08:18:47 GMT
Hi again,

I managed to disable my rowbutton by adding an element with a value that's
filled in by an output widget. This output widget's value is filled in
through a piece of javascript during the binding:

<wb:javascript id="disabled" path="." direction="load">
     if (jxpathContext.getValue("@original") != null)

I use this output widget to just set a value of an extra element:

<wt:widget id="removeRowButton"/><ExtraAttribute name="disabled"><wt:widget

This is filled in by woody template transformer and in my final xsl
stylesheet I just add this element as an attribute to the 'removeRowButton'.
This results in adding an attribute disabled='true' when an element
'ExtraAttribute' is found after an input element.
So far so good, that's what I thought, but when I add a row, the button is
also disabled, so now I'm stuck with enabling the same button again for new
row entries.

While thinking about this, I realize that this isn't the way to do this.
Actually I want to set some of the woody styling attributes at binding time
and I want to access them when a row is added. How can I do this? I've
looked at the api and saw something like 'display data'. Is this where the
styling is done? If so, how do I use it, if not, where/how can I add styling
attributes to a widget from within the binding and in the definition(when
adding a row I need to access them)?

Maybe any other ideas?



----- Original Message ----- 
From: "Jan Hoskens" <>
To: <>
Sent: Monday, February 02, 2004 10:00 AM
Subject: [woody] enable/disable button

> Hi,
> I have a repeater which has 'original' and 'new' rows.I've got a
> add-after for each of them, but I only want a delete-row on the rows that
> were created by the user.
> example (+ and - are the buttons):
> row1(original, from database)                      : name | address | +
> row2(through previous +, created by user)   : name | address | + | -
> Thus the user can create additional rows that initially start with the
> values from the original row (by copying every value explicitly,
> with each user-created row, a delete button should be available.
> I thought of handling this in a piece of javascript when the xml document
> binded to the form. At that moment I know which rows are labeled
> so I want to disable/remove the row-action widget that handles the delete
> for those rows. If the user presses the add-after action, it also should
> create the delete button and show it. I was looking for something like
> enable/disable at first, but did not find anything alike. I thought to
> remove the widget from those rows (in the javascript) but there isn't a
> to remove a widgets from a row (as far as I know).
> Any ideas to do this?
> Thankz,
> Jan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message