You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Joerg Heinicke <jo...@gmx.de> on 2006/10/25 23:10:37 UTC
Re: svn commit: r467749 - /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl
On 25.10.2006 22:07, ltrieloff@apache.org wrote:
> + <xsl:template match="*" mode="copy-parent-id">
> + <xsl:copy>
> + <!-- do not override id if already specified, else use parent id -->
> + <xsl:if test="not(@id)">
> + <xsl:attribute name="id"><xsl:value-of select="../@id"/></xsl:attribute>
> + </xsl:if>
> + <xsl:copy-of select="@*"/>
This check is not necessary, the orignal version works. The reason is,
that the potential attribute on the currently processed element
overwrites the other one, as <xsl:copy-of select="@*"/> is applied after
<xsl:attribute name="id">.
But something more general: This patch looks very specific for a maybe
much more generic problem. This is just a feeling ... have not been
working with CForms since 2 years and never with its Ajax functionality.
What's the actual root cause?
Jörg
Re: svn commit: r467749 - /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl
Posted by Lars Trieloff <la...@trieloff.net>.
Hi Jörg,
Am 25.10.2006 um 23:10 schrieb Joerg Heinicke:
> On 25.10.2006 22:07, ltrieloff@apache.org wrote:
>
>> + <xsl:template match="*" mode="copy-parent-id">
>> + <xsl:copy>
>> + <!-- do not override id if already specified, else use
>> parent id -->
>> + <xsl:if test="not(@id)">
>> + <xsl:attribute name="id"><xsl:value-of select="../@id"/></
>> xsl:attribute>
>> + </xsl:if>
>> + <xsl:copy-of select="@*"/>
>
> This check is not necessary, the orignal version works. The reason
> is, that the potential attribute on the currently processed element
> overwrites the other one, as <xsl:copy-of select="@*"/> is applied
> after <xsl:attribute name="id">.
Thanks for the hint, I did not notice this, but reverted it to the
original state now.
>
> But something more general: This patch looks very specific for a
> maybe much more generic problem. This is just a feeling ... have
> not been working with CForms since 2 years and never with its Ajax
> functionality. What's the actual root cause?
The main problem is that Cocoon-Ajax sends an update-command to the
browser after deactivating or activating a fi:group programatically.
This update-command works on a single HTML element that needs an ID
to be identified.
Forms that use ft:group with AJAX need to wrap everything contained
in the group into a single HTML element to be able to recieve
updates. If this element does not include an ID attribute, updating
does not work either, because the target of the operation cannot be
determined, so this stylesheet fix just copies the ID of the
enclosing fi:group.
Lars
--
Lars Trieloff
visit http://www.mindquarry.com/