AnsweredAssumed Answered

Error while using repeat element +  in a web form

Question asked by dynamolalit on Aug 30, 2009
Hi,

I am using Alfresco 3.1.1 Enterprise version over JBoss 4.2.3 & Firefox 3.5.I have created a sample xsd to create content as

<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:eJustice_Small_Claims="http://www.alfresco.org/alfresco/eJustice_Small_Claims"
   targetNamespace="http://www.alfresco.org/alfresco/eJustice_Small_Claims"
   xmlns:alf="http://www.alfresco.org"   
   elementFormDefault="qualified">

<xs:element name="eJustice_Small_Claims">
      <xs:annotation>
         <xs:documentation source="ospi.label">eJustice_Small_Claims_Title</xs:documentation>
         <xs:documentation source="ospi.description">eJustice_Small_Claims_Desc</xs:documentation>
      </xs:annotation>
      <xs:complexType>
         <xs:sequence>
         <xs:element name="eJustice_language" type="eJustice_Small_Claims:LanguageSelect"
                default="English">
               <xs:annotation>
                   <xs:appinfo>
                     <alf:label>${language}</alf:label>
                     <alf:appearance>compact</alf:appearance>
                    </xs:appinfo>
               </xs:annotation>
         </xs:element>         
<xs:element name="Level1" minOccurs="1" fixed="Going to court" >
   <xs:annotation>
      <xs:documentation source="ospi.label">TextFieldLabel</xs:documentation>
      <xs:documentation source="ospi.description">TextFieldLabelDesc</xs:documentation>
       <xs:appinfo>
      <alf:label>${level1}</alf:label>                     
        </xs:appinfo>
   </xs:annotation>
   <xs:simpleType>
      <xs:restriction base="xs:normalizedString" >
         <xs:maxLength value="20" fixed="true" />
      </xs:restriction>
   </xs:simpleType>
</xs:element>
<xs:element name="Level2" minOccurs="1" fixed="Financial Claims">
   <xs:annotation>
      <xs:documentation source="ospi.label">TextFieldLabel</xs:documentation>
      <xs:documentation source="ospi.description">TextFieldLabelDesc</xs:documentation>
      <xs:appinfo>
      <alf:label>${level2}</alf:label>                     
        </xs:appinfo>
   </xs:annotation>
   <xs:simpleType>
      <xs:restriction base="xs:normalizedString">
         <xs:maxLength value="20" fixed="true" />
      </xs:restriction>
   </xs:simpleType>
</xs:element>
<xs:element name="Level3" minOccurs="1" fixed="Small Claims" >
   <xs:annotation>
      <xs:documentation source="ospi.label">TextFieldLabel</xs:documentation>
      <xs:documentation source="ospi.description">TextFieldLabelDesc</xs:documentation>
      <xs:appinfo>
      <alf:label>${level3}</alf:label>                     
        </xs:appinfo>
   </xs:annotation>
   <xs:simpleType>
      <xs:restriction base="xs:normalizedString">
         <xs:maxLength value="20" fixed="true" />
      </xs:restriction>
   </xs:simpleType>
</xs:element>
<xs:element name="Level4" fixed="" nillable="true" minOccurs="0">
   <xs:annotation>
      <xs:documentation source="ospi.label">TextFieldLabel</xs:documentation>
      <xs:documentation source="ospi.description">TextFieldLabelDesc</xs:documentation>
      <xs:appinfo>
      <alf:label>${level4}</alf:label>                     
        </xs:appinfo>
   </xs:annotation>
   <xs:simpleType>
      <xs:restriction base="xs:normalizedString">
         <xs:maxLength value="20" fixed="true" />
      </xs:restriction>
   </xs:simpleType>
</xs:element>
<xs:element name="Heading" minOccurs="1" default="Small Claims Procedure">
   <xs:annotation>
      <xs:documentation source="ospi.label">TextFieldLabel</xs:documentation>
      <xs:documentation source="ospi.description">TextFieldLabelDesc</xs:documentation>
      <xs:appinfo>
      <alf:label>${heading}</alf:label>                     
        </xs:appinfo>
   </xs:annotation>
   <xs:simpleType>
      <xs:restriction base="xs:normalizedString">
         <xs:maxLength value="30" fixed="true" />
      </xs:restriction>
   </xs:simpleType>
</xs:element>

<xs:element name="Taxonomy" minOccurs="1" fixed="83" >
   <xs:annotation>
      <xs:documentation source="ospi.label">TextFieldLabel</xs:documentation>
      <xs:documentation source="ospi.description">TextFieldLabelDesc</xs:documentation>
      <xs:appinfo>
      <alf:label>${taxonomy}</alf:label>                     
        </xs:appinfo>
   </xs:annotation>
   <xs:simpleType>
      <xs:restriction base="xs:normalizedString">
         <xs:maxLength value="20" fixed="true" />
      </xs:restriction>
   </xs:simpleType>
</xs:element>

<xs:element name="Body_Content" type="xs:string" minOccurs=
                  "1" maxOccurs="1">
            <xs:annotation>
               <xs:appinfo>               
                  <alf:label>${body}</alf:label>   
                  <alf:appearance>custom-styles-mce</alf:appearance>
               </xs:appinfo>
            </xs:annotation>
</xs:element>


<xs:element name="Related_Information"  type="eJustice_Small_Claims:linkInfo"  maxOccurs="unbounded">
<xs:annotation>
               <xs:appinfo>               
                  <alf:label>${realtedInfo}</alf:label>                  
               </xs:appinfo>
         </xs:annotation>
</xs:element>
<xs:element name="Content_Date_of_Expiry" type="xs:date"  nillable="true" minOccurs="0">
<xs:annotation>
   <xs:appinfo>               
      <alf:label>${contentExpiryDate}</alf:label>                  
   </xs:appinfo>
</xs:annotation>
</xs:element>


         </xs:sequence>         
      </xs:complexType>   
   </xs:element>
            
   <xs:complexType name="linkInfo">
      <xs:sequence>
         <xs:element name="Link_Name" type="xs:normalizedString" minOccurs="0" maxOccurs="1" nillable="true" >
         <xs:annotation>
               <xs:appinfo>               
                  <alf:label>${linkName}</alf:label>                  
               </xs:appinfo>
         </xs:annotation>
         </xs:element>
         <xs:element name="Link_URL" type="xs:normalizedString" minOccurs="0" maxOccurs="1" nillable="true" >
         <xs:annotation>
               <xs:appinfo>               
                  <alf:label>${linkUrl}</alf:label>                  
               </xs:appinfo>
         </xs:annotation>
         </xs:element>
         <xs:element name="Link_Description" type="xs:normalizedString" minOccurs="0" maxOccurs="1" nillable="true" >
         <xs:annotation>
               <xs:appinfo>               
                  <alf:label>${LinkDesc}</alf:label>                  
               </xs:appinfo>
         </xs:annotation>
         </xs:element>
         <xs:element name="Owner" type="xs:normalizedString" minOccurs="0" maxOccurs="1" nillable="true" >
         <xs:annotation>
               <xs:appinfo>               
                  <alf:label>${LinkOwner}</alf:label>                  
               </xs:appinfo>
         </xs:annotation>
         </xs:element>
         <xs:element name="Owners_e_Mail_Id" type="xs:normalizedString" minOccurs="0" maxOccurs="1" nillable="true" >
         <xs:annotation>
               <xs:appinfo>               
                  <alf:label>${linkOwnerEmail}</alf:label>                  
               </xs:appinfo>
         </xs:annotation>
         </xs:element>
         
      </xs:sequence>
   </xs:complexType>
   <xs:simpleType name="LanguageSelect">
      <xs:restriction base="xs:normalizedString">
        <xs:enumeration value="български език" id="e"/>
        <xs:enumeration value="ceština"/>
        <xs:enumeration value="Dansk"/>
        <xs:enumeration value="Deutsch"/>
        <xs:enumeration value="Eesti"/>
        <xs:enumeration value="Ελληνικά"/>
        <xs:enumeration value="English"/>
        <xs:enumeration value="Español"/>
        <xs:enumeration value="Français"/>       
        <xs:enumeration value="Gaeilge"/>
        <xs:enumeration value="Italiano"/>
        <xs:enumeration value="latviešu valoda"/>
        <xs:enumeration value="lietuviu kalba"/>
        <xs:enumeration value="Magyar"/>       
        <xs:enumeration value="Malti"/>
        <xs:enumeration value="Nederlands"/>
        <xs:enumeration value="polski"/>
        <xs:enumeration value="Português"/>
        <xs:enumeration value="româna"/>
        <xs:enumeration value="slovencina"/>
        <xs:enumeration value="slovenšcina"/>       
        <xs:enumeration value="suomi;suomen kieli"/>
        <xs:enumeration value="svenska"/>
      </xs:restriction>
   </xs:simpleType>
</xs:schema>

It has repeat element where user can click on the '+' sign to add a repeat group "Related Information" (see xsd).

I am using three languages for creating content:English,French & German.While i have selected English,i am able to click on repeat element for related information complex type(see xsd) & also it is expanding the related information tab without any fault.
But as soon as i select French & German,i am not able to click on repeat element & when i used firebug to see the error,i am getting this


unable to find trigger insert, properties [object Object] for repeat_0
[Break on this error] " for " + this.id);\n


and it is pointing to line no 3315 of xForms.js file under ../scripts/ajax of alfresco.war which is a js function as :


/**
   * Helper function to locate the appropriate repeat item trigger for this repeat.
   * This is done by locating all related widgets via binding, and selecting the
   * Trigger who's action type is the type provided and where the properties
   * provided are the same for that action.  This approach is used rather than simply
   * looking up the trigger by id since the id isn't known for nested repeats as
   * chiba modifies them.
   */
  _getRepeatItemTrigger: function(type, properties)
  {
    var bw = this.xform.getBinding(this.xformsNode).widgets;
    for (var i in bw)
    {
      if (! (bw[i] instanceof alfresco.xforms.Trigger))
      {
        continue;
      }

      var action = bw[i].getActions()[type];
      if (!action)
      {
        continue;
      }

      var propertiesEqual = true;
      for (var p in properties)
      {
        if (!(p in action.properties) ||
            action.properties[p] != properties[p])
        {
          propertiesEqual = false;
          break;
        }
      }
      if (propertiesEqual)
      {
        return bw[i];
      }
    }
    throw new Error("unable to find trigger " + type +
                    ", properties " + properties +
                    " for " + this.id);

  },

After some googling i found this bug in Alfresco

https://issues.alfresco.com/jira/browse/ETHREEOH-1891?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

But its resolution is fixed & status is closed for Alfresco 3.1 SP1 which i am using i.e. v 3.1.1 but for me it is not working for languages other then English.

Can anyone give me an idea about this.

Outcomes