cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down

lakshmi
Champ in-the-making
Champ in-the-making
Hi,

Am creating my own xsd for attaching a web form to my web project.
I need to create drop down,text box etc..
I have problem with drop down. For options less than 5 i get radio button rather than a drop down

my code is as follows:

<?xml version="1.0" encoding="UTF-8"?>

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


<xs:simpleType name="Subject">
    <xs:restriction base="xs:string">
      <xs:enumeration value="OperatingSystems"/>
      <xs:enumeration value="ProgrammingLanguages"/>
      <xs:enumeration value="Databases"/>
      <xs:enumeration value="ContentManagement"/>
      </xs:restriction>
  </xs:simpleType>


<xs:simpleType name="SubjectDetail">
    <xs:restriction base="xs:string">
      <xs:enumeration value="1"/>
      <xs:enumeration value="2"/>
      <xs:enumeration value="3"/>
      <xs:enumeration value="4"/>
      <xs:enumeration value="5">
      <xs:enumeration value="6"/>
     </xs:restriction>
  </xs:simpleType>

 
  <xs:element name="ncontent">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Name" type="xs:normalizedString" use="required"/>
        <xs:element name="Title" type="xs:normalizedString"/>
        <xs:element name="Description" type="xs:normalizedString"/>
         <xs:element name="Subject" type="prSmiley Frustratedubject"/>
       <xs:element name="SubjectDetail" type="prSmiley FrustratedubjectDetail"/>
     </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>


here Subject(only 4 options)is displayed as drop down and subjectDetail (6 options)is dispalyed as drop down.

Plz advice me how to display drop down…
I tried using , but had no effect:

<xs:element name="Subject" type="prSmiley Frustratedubject">
                <xs:annotation><xs:appinfo><alf:appearance>minimal</alf:appearance></xs:appinfo></xs:annotation>
              </xs:element>


FYI am using alfresco-community-tomcat-2.0.0 bundle.

Thanks,
Lakshmi
2 REPLIES 2

arielb
Champ in-the-making
Champ in-the-making
what you need is the minimal appearance attribute.  i'm not sure it went into 2.0.0 - it might just be a 2.0.1 or even 2.1 feature.

lakshmi
Champ in-the-making
Champ in-the-making
Thanks, it works with 2.0 release.

I got it using alf:appearance –>minimal.

Here are excerpts from my code:

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

<xs:simpleType name="Subject">
    <xs:restriction base="xs:string">
      <xs:enumeration value="OperatingSystems"/>
      <xs:enumeration value="ProgrammingLanguages"/>
      <xs:enumeration value="Databases"/>
   <xs:enumeration value="ContentManagement"/>
      </xs:restriction>
  </xs:simpleType>



<xs:element name="news_content">
    <xs:complexType>

  <xs:attribute name="Subject" type="prSmiley Frustratedubject">
                <xs:annotation><xs:appinfo><alf:appearance>minimal</alf:appearance></xs:appinfo></xs:annotation>
        </xs:attribute>


    </xs:complexType>
  </xs:element>
</xs:schema>

Thanks for your suggestion.

Lakshmi.