cancel
Showing results for 
Search instead for 
Did you mean: 

Web Form Displays Incompletely

buck_99
Champ in-the-making
Champ in-the-making
I have a web form that works great (in FoxPro and Safari, not in IE7, but that's a different matter), but it only works the first time.  When I finish using the form to create new web content, I can't then go on to create another new content item using the same web form, regardless of what name I give it.  Only the first two fields and the label for the third field appear on the second go-round.  I have to log out and log back in to be able to see the form in its entirety again.

Here are images from the tests:
Before:
[img]http://i123.photobucket.com/albums/o296/uncleflow/work/Test6.jpg[/img]

After:
[img]http://i123.photobucket.com/albums/o296/uncleflow/work/Test7.jpg[/img]

Here is the schema:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:bc="http://www.alfresco.org/alfresco/bc"
           targetNamespace="http://www.alfresco.org/alfresco/bc"
           elementFormDefault="qualified">

  <!– Department –>
  <xs:simpleType name="department">
    <xs:restriction base="xs:normalizedString">
      <xs:enumeration value="Accounts Payable"/>
      <xs:enumeration value="Communications"/>
      <xs:enumeration value="Finance"/>
      <xs:enumeration value="Human Resources"/>
      <xs:enumeration value="IT and Help Desk"/>
      <xs:enumeration value="Payroll"/>
      <xs:enumeration value="Purchasing"/>
      <xs:enumeration value="Records and Archives"/>
      <xs:enumeration value="Travel"/>
    </xs:restriction>
  </xs:simpleType>

  <!– Category –>
  <xs:simpleType name="category">
    <xs:restriction base="xs:normalizedString">
      <xs:enumeration value="Mission"/>
      <xs:enumeration value="Contact"/>
      <xs:enumeration value="Announcement"/>
      <xs:enumeration value="Upcoming Event"/>
    </xs:restriction>
  </xs:simpleType>
 
  <!– Image Size –>
  <xs:simpleType name="size">
    <xs:restriction base="xs:normalizedString">
      <xs:enumeration value="Small"/>
      <xs:enumeration value="Medium"/>
      <xs:enumeration value="Large"/>
    </xs:restriction>
  </xs:simpleType>
 
  <!– Image Alignment –>
  <xs:simpleType name="alignment">
    <xs:restriction base="xs:normalizedString">
      <xs:enumeration value="Left"/>
      <xs:enumeration value="Center"/>
      <xs:enumeration value="Right"/>
    </xs:restriction>
  </xs:simpleType>
 
  <!– News body section:  repeatable element –>
  <xs:complexType name="section">
    <xs:sequence>
      <xs:element name="image" type="bc:image" nillable="true"/>
      <xs:element name="text" type="xs:string" minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>
 
  <!– Image info:  file location, size, and alignment –>
  <xs:complexType name="image">
     <xs:sequence>
        <xs:element name="file" type="xs:normalizedString" minOccurs="1" maxOccurs="1"/>
        <xs:element name="size" type="bc:size" default="Small" minOccurs="1" maxOccurs="1"/>
        <xs:element name="alignment" type="bc:alignment" default="Left" minOccurs="1" maxOccurs="1"/>
     </xs:sequence>
  </xs:complexType>
 
  <!– defines the form for creating a news story –>
  <xs:element name="basic-content">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="title" type="xs:normalizedString" minOccurs="1" maxOccurs="1"/>
        <xs:element name="abstract" type="xs:normalizedString" minOccurs="1" maxOccurs="1"/>
        <xs:element name="date_added" type="xs:date"/> <!– How to put current date as default? –>
        <xs:element name="bodySection" type="bc:section" minOccurs="1" maxOccurs="unbounded"/>
        <xs:element name="keywords" type="xs:normalizedString" minOccurs="0" maxOccurs="1"/>
      <xs:element name="department" type="bc:department" default="HHMI Company-wide"/>
      <xs:element name="category" type="bc:category"/>
      <xs:element name="launch_date" type="xs:date" minOccurs="0" maxOccurs="1"/>
      <xs:element name="expiration_date" type="xs:date" minOccurs="0" maxOccurs="1"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Thanks for any help!

- Scott
1 REPLY 1

steventux
Champ in-the-making
Champ in-the-making
Do you get javascript errors on the second load of the form? If so it could be that the date picker widget is causing this.
If you can build the web-client project from source try adding the script
"/scripts/ajax/dojo/src/date/serialize.js"
to the JS_SCRIPTS array in org.alfresco.web.forms.xforms.XFormsProcessor
so you get
private final static String[] JS_SCRIPTS = 
   {
      "/scripts/tiny_mce/" + (LOGGER.isDebugEnabled()
                              ? "tiny_mce_src.js"
                              : "tiny_mce.js"),
      "/scripts/ajax/dojo/" + (LOGGER.isDebugEnabled()
                               ? "dojo.js.uncompressed.js"
                               : "dojo.js"),
      "/scripts/ajax/mootools.v1.11.js",
      "/scripts/ajax/common.js",
      "/scripts/ajax/ajax_helper.js",
      "/scripts/ajax/tiny_mce_wcm_extensions.js",
      "/scripts/ajax/xforms.js",
      "/scripts/ajax/file_picker_widget.js",
      "/scripts/upload_helper.js",
      "/scripts/ajax/dojo/src/date/serialize.js"
   };