cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Chávez <>
Subject Re: [Forms] Bug in Ajax when changing widget state?
Date Sun, 30 Dec 2007 06:39:59 GMT
>> Hi people,

>> still trying to push CForms to its limits ;) I found what might be a
>> bug in the Ajax implementations. I have an event handler that switches
> the state of a widget from ACTIVE to INVISIBLE and vice-versa. When not
> using Ajax, everything works fine, but when ajax="true" the widget
> appears and disappears as expected, but its label stays forever hidden!

> Two points to note here:

> 1. the widget state is initially INVISIBLE
> 2. the widget is laid out in a group using <fi:styling type="colums"/>

> Can anyone else confirm this?

> 	Ugo

> Ugo Cei
> Tech Blog:
> Open Source Zone:
> Wine & Food Blog:

Hi People,

I found the message above that it's an old message, but that still being an
issue on CForms.

I found that the label field is not visible again because we only sent the
<bu:replace> <span id="..."> ...</span> </bu:replace> for the input
but for the label we don't have anything similar.

When we show the form that initially have a field invisible and the field
it's on a <fi:group> ... we sent a placeholder for the field and this
generate this:

<label class="forms placeholder" id="field2:label" for="field2:input"


<span id="field2"/>

for example for a field "field2" (that is because the XSLT, now we only
generate the SAX's event only for the input, the label tag is generate
because the XSLT)

Now, when we got visible the field, the <bu:replace> <span id="..."> it's
just only for the field, we don't manage in anyway the label tag.

This is similar if the field it's initially visible, when we got invisible
the input field is gone, but the label still there because we don't manage
the label on the ajax update.

This is similar too when we use the <widget-label id="..."> ... tag, this
generate the raw text of the label it does not generate the html tag
<label ...> and i think we should generate and we should add ad "id"
attribute to the <label> tag, so some how we can manage the label tag on a
ajax replace.

Now, I'm not sure how we can manage the label, we don't generate the label
on the SAX events, we generate the label on the XSLT, the thing is how can
we know that the ajax update should contains the label replacement? we can
generate always and the ajax update try to find the label, but don't
generate any error if we don't find, but looks like a hack.

any thoughts ?

Carlos Chávez

View raw message