You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "vincent Demay (JIRA)" <ji...@apache.org> on 2006/04/13 15:41:21 UTC

[jira] Created: (COCOON-1825) Ajax errror when an active state widget become invisible state widget

Ajax errror when an active state widget become invisible state widget
---------------------------------------------------------------------

         Key: COCOON-1825
         URL: http://issues.apache.org/jira/browse/COCOON-1825
     Project: Cocoon
        Type: Bug

  Components: Blocks: Forms  
    Versions: 2.1.9    
    Reporter: vincent Demay


Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.

I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.

I think about 2 patches : 
*putting a <span></span> in forms-field-styling.xsl where is not set
*or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)



Here is the patch for first 

--- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
+++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
@@ -198,8 +198,9 @@
     <xsl:variable name="value" select="fi:value"/>
     <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
     <xsl:choose>
-      <xsl:when test="$vertical">
-        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
+      <xsl:when test="$vertical">	
+      	  <span id="{$id}">
+          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
           <xsl:for-each select="fi:selection-list/fi:item">
             <xsl:variable name="item-id" select="concat($id, ':', position())"/>
             <tr>
@@ -224,6 +225,7 @@
             </tr>
           </xsl:for-each>
         </table>
+        </span>
       </xsl:when>
       <xsl:otherwise>
         <span id="{$id}" title="{fi:hint}">
@@ -682,22 +684,24 @@
       | know where to insert the widget if it becomes visible
       +-->
   <xsl:template match="fi:placeholder">
-    <span id="{@id}"/>
+    <span id="{@id}"><xsl:apply-templates/></span>
   </xsl:template>
   
   <!--+
       | fi:struct - has no visual representation by default
       +-->
   <xsl:template match="fi:struct">
-    <xsl:apply-templates/>
+     <span id="{@id}"><xsl:apply-templates/></span>
   </xsl:template>
 
   <!--+
       | fi:group - has no visual representation by default
       +-->
   <xsl:template match="fi:group">
-    <xsl:apply-templates/>
+    <span id="{@id}"><xsl:apply-templates/></span>
   </xsl:template>
+  
+  
 
   <xsl:template match="@*|node()" priority="-1">
     <xsl:copy>




Here for the second


--- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
+++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
@@ -483,6 +483,10 @@
     public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
     throws SAXException {
 
+    	AttributesImpl placeHolderAttrs = new AttributesImpl();
+    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
+        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
+        
         if (getCombinedState().isDisplayingValues()) {
             // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
             String element = this.getXMLElementName();
@@ -497,15 +501,9 @@
 
             generateItemSaxFragment(contentHandler, locale);
 
-            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
-
-        } else {
-            // Generate a placeholder that can be used later by AJAX updates
-            AttributesImpl attrs = new AttributesImpl();
-            attrs.addCDATAAttribute("id", getRequestParameterName());
-            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
-            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
+            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
         }
+        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
     }
 
 	public Object getAttribute(String name) {


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1825) Ajax errror when an active state widget become invisible state widget

Posted by "Sylvain Wallez (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1825?page=comments#action_12413991 ] 

Sylvain Wallez commented on COCOON-1825:
----------------------------------------

I don't see how surrounding the <table> with a <span> changes something. Or... I remember of a bug in IE that doesn't like tables to be replaced in JavaScript or something related.

Adding an element for <fi:group> and <fi:struct> is good, but I'm wondering if this should be a <div> rather than a <span>.

<fi:placeholder> are used to mark the place of hidden widgets and should be kept empty.

> Ajax errror when an active state widget become invisible state widget
> ---------------------------------------------------------------------
>
>          Key: COCOON-1825
>          URL: http://issues.apache.org/jira/browse/COCOON-1825
>      Project: Cocoon
>         Type: Bug

>   Components: Blocks: Forms
>     Versions: 2.1.9
>     Reporter: vincent Demay
>     Assignee: Antonio Gallardo

>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (COCOON-1825) Ajax error when an active state widget become invisible state widget

Posted by "Jörg Heinicke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-1825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg Heinicke updated COCOON-1825:
----------------------------------

    Summary: Ajax error when an active state widget become invisible state widget  (was: [PATCH] Ajax error when an active state widget become invisible state widget)

> Ajax error when an active state widget become invisible state widget
> --------------------------------------------------------------------
>
>                 Key: COCOON-1825
>                 URL: https://issues.apache.org/jira/browse/COCOON-1825
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: Vincent Demay
>            Assignee: Antonio Gallardo
>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COCOON-1825) Ajax errror when an active state widget become invisible state widget

Posted by "Antonio Gallardo (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1825?page=all ]

Antonio Gallardo updated COCOON-1825:
-------------------------------------


Should I need to apply both patched or just one?

> Ajax errror when an active state widget become invisible state widget
> ---------------------------------------------------------------------
>
>          Key: COCOON-1825
>          URL: http://issues.apache.org/jira/browse/COCOON-1825
>      Project: Cocoon
>         Type: Bug

>   Components: Blocks: Forms
>     Versions: 2.1.9
>     Reporter: vincent Demay
>     Assignee: Antonio Gallardo

>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1825) Ajax errror when an active state widget become invisible state widget

Posted by "Antonio Gallardo (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1825?page=comments#action_12442267 ] 
            
Antonio Gallardo commented on COCOON-1825:
------------------------------------------

IN the first part of the patch, there is: 

+ <span id="{$id}">
+ <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}"> 

I don't think it is a good idea to have the same id in 2 different elements. It seems like it might blow somewhere else.

how we can fix this?

> Ajax errror when an active state widget become invisible state widget
> ---------------------------------------------------------------------
>
>                 Key: COCOON-1825
>                 URL: http://issues.apache.org/jira/browse/COCOON-1825
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: vincent Demay
>         Assigned To: Antonio Gallardo
>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (COCOON-1825) Ajax errror when an active state widget become invisible state widget

Posted by "Jörg Heinicke (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1825?page=all ]

Jörg Heinicke updated COCOON-1825:
----------------------------------


> Ajax errror when an active state widget become invisible state widget
> ---------------------------------------------------------------------
>
>                 Key: COCOON-1825
>                 URL: http://issues.apache.org/jira/browse/COCOON-1825
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: vincent Demay
>         Assigned To: Antonio Gallardo
>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Updated: (COCOON-1825) [PATCH] Ajax error when an active state widget become invisible state widget

Posted by "Jorg Heymans (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1825?page=all ]

Jorg Heymans updated COCOON-1825:
---------------------------------

    Summary: [PATCH] Ajax error when an active state widget become invisible state widget  (was: Ajax errror when an active state widget become invisible state widget)

> [PATCH] Ajax error when an active state widget become invisible state widget
> ----------------------------------------------------------------------------
>
>                 Key: COCOON-1825
>                 URL: http://issues.apache.org/jira/browse/COCOON-1825
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: vincent Demay
>         Assigned To: Antonio Gallardo
>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (COCOON-1825) [PATCH] Ajax error when an active state widget become invisible state widget

Posted by "Antonio Gallardo (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1825?page=all ]

Antonio Gallardo updated COCOON-1825:
-------------------------------------


Would you provide a full patch? The latest looks like a partial patch without the initial patch.

> [PATCH] Ajax error when an active state widget become invisible state widget
> ----------------------------------------------------------------------------
>
>                 Key: COCOON-1825
>                 URL: http://issues.apache.org/jira/browse/COCOON-1825
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: vincent Demay
>         Assigned To: Antonio Gallardo
>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (COCOON-1825) Ajax errror when an active state widget become invisible state widget

Posted by "Guillaume Déflache (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1825?page=comments#action_12442276 ] 
            
Guillaume Déflache commented on COCOON-1825:
--------------------------------------------

About Antonio's last comment: I think Vincent needs to tell us why he added a 'span' element with the 'id' attribute when there already was the 'table' element to "hook" the 'id' attribute to. Was that really to workaround an IE bug as Sylvain suggested, or was only a copy/paste error?

To sum up, for the others modifications IMHO:
1) "fi:placeholder" should be left alone as Sylvain said
2) "fi:group" and "fi:struct" should use a "div" element instead of a "span" one, because if we do so:
   i) hope to validate Cocoon Forms HTML generated pages remains: spans cannot contain block markup, whereas divs can contain both inline and block markup, so nested "div-fi:*'s" are more likely to produce valid HTML
   ii) this is consistent with the way "fi:union" is already handled
   also:
   iii) for rendering issues, these divs can always be made inline in CSS if needed
   iv) in practice groups (and structs? never used them) almost always are block-level anyway... 
 3) BTW the "fi:imagemap" template probably also lacks an "id" attribute... and I have not checked "advanced" styling, there could be more missing... (BTW isn't GoogleMap widget _advanced_ styling!?!)

So I volunteer to redo the 1st proposed patch with all above suggestions applied! :)
But please Vincent do tell us what was your purpose with the "double-id" thingy!

BTW perhaps someone could add "[PATCH]" in the subject (and fix the typo...) to show a patch is available?

> Ajax errror when an active state widget become invisible state widget
> ---------------------------------------------------------------------
>
>                 Key: COCOON-1825
>                 URL: http://issues.apache.org/jira/browse/COCOON-1825
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: vincent Demay
>         Assigned To: Antonio Gallardo
>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Closed: (COCOON-1825) Ajax error when an active state widget become invisible state widget

Posted by "Jörg Heinicke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-1825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg Heinicke closed COCOON-1825.
---------------------------------

                     Resolution: Fixed
                  Fix Version/s: 2.2-dev (Current SVN)
                                 2.1.12-dev (Current SVN)
    Affects version (Component): Parent values: Blocks: Forms(10167). Level 1 values: 1.0.0-RC3-SNAPSHOT(10331). 
        Fix version (Component): Parent values: Blocks: Forms(10239). 

The fix for fi:group was already in SVN, just broken in Cocoon 2.2/Cocoon Forms 1.0/1.1 (COCOON-2204). Applied fix for fi:struct.

> Ajax error when an active state widget become invisible state widget
> --------------------------------------------------------------------
>
>                 Key: COCOON-1825
>                 URL: https://issues.apache.org/jira/browse/COCOON-1825
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: Vincent Demay
>            Assignee: Jörg Heinicke
>             Fix For: 2.1.12-dev (Current SVN), 2.2-dev (Current SVN)
>
>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (COCOON-1825) Ajax error when an active state widget become invisible state widget

Posted by "Jörg Heinicke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-1825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jörg Heinicke reassigned COCOON-1825:
-------------------------------------

    Assignee: Jörg Heinicke  (was: Antonio Gallardo)

> Ajax error when an active state widget become invisible state widget
> --------------------------------------------------------------------
>
>                 Key: COCOON-1825
>                 URL: https://issues.apache.org/jira/browse/COCOON-1825
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: Vincent Demay
>            Assignee: Jörg Heinicke
>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1825) Ajax errror when an active state widget become invisible state widget

Posted by "vincent Demay (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1825?page=comments#action_12413992 ] 

vincent Demay commented on COCOON-1825:
---------------------------------------

I think the better is the first one : putting a span around each element. So you can apply only the first one on forms-field-styling.xsl.

Thanks.



> Ajax errror when an active state widget become invisible state widget
> ---------------------------------------------------------------------
>
>          Key: COCOON-1825
>          URL: http://issues.apache.org/jira/browse/COCOON-1825
>      Project: Cocoon
>         Type: Bug

>   Components: Blocks: Forms
>     Versions: 2.1.9
>     Reporter: vincent Demay
>     Assignee: Antonio Gallardo

>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1825) [PATCH] Ajax error when an active state widget become invisible state widget

Posted by "Antonio Gallardo (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1825?page=comments#action_12442322 ] 
            
Antonio Gallardo commented on COCOON-1825:
------------------------------------------

I asked about the duplicated id just to be sure, but I believe it is a typo.
I agree it is better to use div instead of span.
Sure feel free to send a patch. I will be glad to apply it. :-)

> [PATCH] Ajax error when an active state widget become invisible state widget
> ----------------------------------------------------------------------------
>
>                 Key: COCOON-1825
>                 URL: http://issues.apache.org/jira/browse/COCOON-1825
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: vincent Demay
>         Assigned To: Antonio Gallardo
>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (COCOON-1825) [PATCH] Ajax error when an active state widget become invisible state widget

Posted by "vincent Demay (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1825?page=comments#action_12442413 ] 
            
vincent Demay commented on COCOON-1825:
---------------------------------------

I think this simple patch could resolve the issue :

Index: C:/Program Files/Eclipse3.01/workspace/forms/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl
===================================================================
--- C:/Program Files/Eclipse3.01/workspace/forms/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl	(revision 464244)
+++ C:/Program Files/Eclipse3.01/workspace/forms/resources/org/apache/cocoon/forms/resources/forms-field-styling.xsl	(working copy)
@@ -730,14 +730,18 @@
       | fi:struct - has no visual representation by default
       +-->
   <xsl:template match="fi:struct">
-    <xsl:apply-templates/>
+  	<div id="{@id}">
+    	<xsl:apply-templates/>
+    </div>
   </xsl:template>
 
   <!--+
       | fi:group - has no visual representation by default
       +-->
   <xsl:template match="fi:group">
-    <xsl:apply-templates/>
+    <div id="{@id}">
+  		<xsl:apply-templates/>
+  	</div>
   </xsl:template>
 
   <xsl:template match="@*|node()" priority="-1">


> [PATCH] Ajax error when an active state widget become invisible state widget
> ----------------------------------------------------------------------------
>
>                 Key: COCOON-1825
>                 URL: http://issues.apache.org/jira/browse/COCOON-1825
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.9
>            Reporter: vincent Demay
>         Assigned To: Antonio Gallardo
>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (COCOON-1825) Ajax errror when an active state widget become invisible state widget

Posted by "Antonio Gallardo (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1825?page=all ]

Antonio Gallardo reassigned COCOON-1825:
----------------------------------------

    Assign To: Antonio Gallardo

> Ajax errror when an active state widget become invisible state widget
> ---------------------------------------------------------------------
>
>          Key: COCOON-1825
>          URL: http://issues.apache.org/jira/browse/COCOON-1825
>      Project: Cocoon
>         Type: Bug

>   Components: Blocks: Forms
>     Versions: 2.1.9
>     Reporter: vincent Demay
>     Assignee: Antonio Gallardo

>
> Some widget (field with selection-list and styling=radio, group, etc...)  can not be hidden (state=invisible)in ajax mode.
> I declare some widgets without state attribute in the form definition, my form is in ajax mode, when I set the widget state to INVISIBLE, the ajax response can not be applied to the form because <span id="widget-name">...</span> is not available in source code.
> I think about 2 patches : 
> *putting a <span></span> in forms-field-styling.xsl where is not set
> *or modifing abstractWidgetDefinition.java in ordre to generate a placeholder around each widget (but patch seems to need a lot of modification in forms-field-styling.xsl too)
> Here is the patch for first 
> --- forms-field-styling.orig	2006-04-13 15:37:06.590221200 +0200
> +++ forms-field-styling.xsl	2006-04-13 15:38:22.525291200 +0200
> @@ -198,8 +198,9 @@
>      <xsl:variable name="value" select="fi:value"/>
>      <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
>      <xsl:choose>
> -      <xsl:when test="$vertical">
> -        <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
> +      <xsl:when test="$vertical">	
> +      	  <span id="{$id}">
> +          <table id="{$id}" cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
>            <xsl:for-each select="fi:selection-list/fi:item">
>              <xsl:variable name="item-id" select="concat($id, ':', position())"/>
>              <tr>
> @@ -224,6 +225,7 @@
>              </tr>
>            </xsl:for-each>
>          </table>
> +        </span>
>        </xsl:when>
>        <xsl:otherwise>
>          <span id="{$id}" title="{fi:hint}">
> @@ -682,22 +684,24 @@
>        | know where to insert the widget if it becomes visible
>        +-->
>    <xsl:template match="fi:placeholder">
> -    <span id="{@id}"/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>    
>    <!--+
>        | fi:struct - has no visual representation by default
>        +-->
>    <xsl:template match="fi:struct">
> -    <xsl:apply-templates/>
> +     <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
>  
>    <!--+
>        | fi:group - has no visual representation by default
>        +-->
>    <xsl:template match="fi:group">
> -    <xsl:apply-templates/>
> +    <span id="{@id}"><xsl:apply-templates/></span>
>    </xsl:template>
> +  
> +  
>  
>    <xsl:template match="@*|node()" priority="-1">
>      <xsl:copy>
> Here for the second
> --- AbstractWidget.orig	2006-04-13 15:31:07.851701200 +0200
> +++ AbstractWidget.java	2006-04-13 15:30:31.446616200 +0200
> @@ -483,6 +483,10 @@
>      public void generateSaxFragment(ContentHandler contentHandler, Locale locale)
>      throws SAXException {
>  
> +    	AttributesImpl placeHolderAttrs = new AttributesImpl();
> +    	placeHolderAttrs.addCDATAAttribute("id", getRequestParameterName());
> +        contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", placeHolderAttrs);
> +        
>          if (getCombinedState().isDisplayingValues()) {
>              // FIXME: we may want to strip out completely widgets that aren't updated when in AJAX mode
>              String element = this.getXMLElementName();
> @@ -497,15 +501,9 @@
>  
>              generateItemSaxFragment(contentHandler, locale);
>  
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);
> -
> -        } else {
> -            // Generate a placeholder that can be used later by AJAX updates
> -            AttributesImpl attrs = new AttributesImpl();
> -            attrs.addCDATAAttribute("id", getRequestParameterName());
> -            contentHandler.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
> -            contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
> +            contentHandler.endElement(FormsConstants.INSTANCE_NS, element, FormsConstants.INSTANCE_PREFIX_COLON + element);         
>          }
> +        contentHandler.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
>      }
>  
>  	public Object getAttribute(String name) {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira