AnsweredAssumed Answered

Issues in Multiple Included File Picker widget in  Web Form

Question asked by dhavalprajapati on Mar 24, 2011
Hello,

i am facing below issue in File Picker Widget :

·         Upload XSDs (included1.xsd and included2.xsd) into "Company Home" Space.
·         Create Web Form with XSD (includetest.xsd) which include the above two XSDs using Web script.                    
                             Scenario 1 : (Fail)
·         When a user starts creating a content item using this form, both components are in a minimized mode.
·         Insert/create the components (TextLine1 and TextLine2) by clicking on the plus-sign.
·         Now, click on the “Next” or “Finish” button. The form will return validation messages (Included Text 1 cannot be empty, Included Text 2 cannot be empty) as intended.
·         Now, type some text into first component (Included Text 1) and insert/create another component (Text Line2) by clicking on the plus-sign. Click next.
·         The form will return an incorrect error message. The value entered into the first component (Included Text 1) will be ignored.
Error message: Included Text 1 cannot be empty, Included Text 2 cannot be empty, Included Text 2 cannot be empty
·         Expected Result : It should validate properly. The value entered into the first component should be recognized as valid.

Conclusion: The problem occurs when a parent XSD includes multiple child XSDs. Each child XSD generates a separate component within the same form. It appears that when the focus is taken from one component to the other, validation rules for the first component fail, in other words one component event cannot be recognized within another

Please find below XSDs :

included1.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:alf="http://www.alfresco.org"
           xmlns:wcm="http://www.alfresco.org/wcm"
           targetNamespace="http://www.alfresco.org/wcm"
           elementFormDefault="qualified">
   
      <xs:complexType abstract="true" name="included1">
         <xs:sequence>      
            <xs:element name="includedText" type="xs:normalizedString" maxOccurs="unbounded">
               <xs:annotation>
                  <xs:appinfo>
                     <alf:label>Included Text 1</alf:label>
                     <alf:alert>Included Text 1 cannot be empty</alf:alert>
                  </xs:appinfo>
               </xs:annotation>                     
            </xs:element>
         </xs:sequence>
      </xs:complexType>   
</xs:schema>

included2.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:alf="http://www.alfresco.org"
           xmlns:wcm="http://www.alfresco.org/wcm"
           targetNamespace="http://www.alfresco.org/wcm"
           elementFormDefault="qualified">
   
      <xs:complexType abstract="true" name="included2">
         <xs:sequence>      
            <xs:element name="includedText" type="xs:normalizedString" maxOccurs="unbounded">
               <xs:annotation>
                  <xs:appinfo>
                     <alf:label>Included Text 2</alf:label>
                     <alf:alert>Included Text 2 cannot be empty</alf:alert>
                  </xs:appinfo>
               </xs:annotation>                     
            </xs:element>
         </xs:sequence>
      </xs:complexType>   
</xs:schema>

includetest.xsd :

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:alf="http://www.alfresco.org"
           xmlns:wcm="http://www.alfresco.org/wcm"
           targetNamespace="http://www.alfresco.org/wcm"
           elementFormDefault="qualified">
   
   <xs:include schemaLocation="webscript://api/path/content/workspace/SpacesStore/Company Home/included1.xsd?ticket={ticket}" />
   <xs:include schemaLocation="webscript://api/path/content/workspace/SpacesStore/Company Home/included2.xsd?ticket={ticket}" />
   
   <xs:element name="includetest">
      <xs:complexType>
         <xs:sequence>      
            <xs:element name="TextLine1" type="wcm:included1" minOccurs="0" maxOccurs="unbounded">                                 
            </xs:element>
            
            <xs:element name="TextLine2" type="wcm:included2" minOccurs="0" maxOccurs="unbounded">                                 
            </xs:element>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>

Please let me know if is there any workaround to resolve this issue.

Outcomes