cancel
Showing results for 
Search instead for 
Did you mean: 

customization of web forms

hansraj
Champ in-the-making
Champ in-the-making
Hi,

I want to customize a widget in web forms.
I have the following reuirements:
1). fetching data from database and displaying in the combo box widget.
2) validating the date (calender widget)

could anybody answer these please?

Regards,
Hansraj
3 REPLIES 3

tommorris
Champ in-the-making
Champ in-the-making
Hi,

For your second point, doesn't the following work for you? It should display a calendar.
<xs:element name="date" type="xs:date"/>

For your first point, you can use the XSD import (or include) element, something like this:
<xs:include schemaLocation="/list-lookup-pages/products.xsd"/>
The URL references a resource that can be found on the AVM staging sandbox. It will use the preview tomcat server to evaluate and return the results of this resource for you. This means that you can actually refer to a JSP instead of a static XSD fragment. Like so:
<xs:include schemaLocation="/list-lookup-pages/products.xsd.jsp"/>
As long as the results from the JSP page is a valid XSD inclusion, then that's fine. So, you can write code within the JSP that makes the appropriate calls to your database and constructs well-formed XSD output.

Here's a complete example:
(I switch to using the 'import' element instead of the 'include', to show a cleaner namespaced approach)

The main web-form:

<?xml version="1.0"?>
<xs:schema
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:alf="http://www.alfresco.com/"
   xmlns:prodlist="http://www.ixxus.co.uk/myproject/prodlist"
   xmlns:product="http://www.ixxus.co.uk/myproject/product"
   targetNamespace="http://www.ixxus.co.uk/myproject/product"
   elementFormDefault="qualified">

   <xs:import schemaLocation="/list-lookup-pages/products.xsd.jsp" namespace="http://www.ixxus.co.uk/myproject/prodlist'/>

   <xs:element name="product">
      <xs:complexType>
         <xs:sequence>
            <xs:element name="quantity" type="xs:integer"/>
            <xs:element name="product" type="prodlist:prodlookup" minOccurs="1" maxOccurs="unbounded"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>

The /list-lookup-pages/product.xsd.jsp page should generate output that looks like the following:

<xs:schema
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:alf="http://www.alfresco.com/"
   xmlns:prodlist="http://www.ixxus.co.uk/myproject/prodlist"
   targetNamespace="http://www.ixxus.co.uk/myproject/prodlist"
   elementFormDefault="qualified">

   <xs:simpleType name="prodlookup">
      <xs:restriction base="xs:normalizedString">
         <xs:enumeration value="Product 1"/>
         <xs:enumeration value="Product 2"/>
         <xs:enumeration value="Product 3"/>
         <xs:enumeration value="Product 4"/>
         <xs:enumeration value="Product 5"/>
      </xs:restriction>
   </xs:simpleType>
</xs:schema>

Don't forget to set the encoding correctly from the JSP response.

Is that helpful?

Tom.

hansraj
Champ in-the-making
Champ in-the-making
Hi,
Thank you for ur reply.
I guess it's going to be a useful reply for me.
I'll let u know the result.

Regards,
Hansraj

deas0815
Star Contributor
Star Contributor
Hallo everybody,

I personally don't really  like the approach xs:including/-importing a jsp in the sandbox which probably  uses a taglib
as found in the examples. The jsp/taglib has to be in every sandbox, and I don't like jsps and taglibs anyways.

I'm working on a webscript based replacement  for the  jsp/taglib. My only problem left here is how to pass the
avm store (i.e. demo–admin) parameter to the webscript. You should  of course not "hard-code" it in the  Schema.

I guess the alfresco xforms classes need to be extended.

Any  suggestions for another "more clean" approach are appreciated.

regards
Andreas
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.