cancel
Showing results for 
Search instead for 
Did you mean: 

How to add checkboxes, Radiobuttons to forms

nikhil
Champ in-the-making
Champ in-the-making
Hi,

Can anyone please run me through the procedure to add checkboxes and radiobuttons to forms?

is there any type like xs:simpletype (for drop downs) which can be configured for checkboxes and radiobuttons

Please help!

Regards,
Nikhil Sharma
11 REPLIES 11

sbzoom
Champ in-the-making
Champ in-the-making
Ok.  I figured out what I did wrong.

I changed this:

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

To what I have been using on my own xsds:

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

You'd think, so what?  Well, if I have a "targetNamespace" than everything changes.  You have to have a namespace in front of a reference to
a previous element:

  <xs:simpleType name="four_presidents_list">
    <xs:list itemType="four_presidents"/>
  </xs:simpleType>

Has to be this:

  <xs:simpleType name="four_presidents_list">
    <xs:list itemType="amm:four_presidents"/>
  </xs:simpleType>

Lesson learned.  Either get rid of my targetNamespace or keep this in mind.


Charlie

robinflow
Champ in-the-making
Champ in-the-making
Thanks kevin, it cleared some of my issues up, but also introduced a problem, namely it doesn't save the correct values in Internet Explorer (IE Version: 7.0.5730.13) - it's always saving the default values into the xml regardless your choosing. Also, the radio buttons can not be changed at all. (And it doesn't seem to render buttons according to the Forms Authoring Guide in the Wiki: http://wiki.alfresco.com/wiki/Forms_Authoring_Guide - just compared kevin's sample code using the Create Content dialog).
In FF it seems ok.

Another question though: is there any way to display the xml content similarly to the Edit function (which renders with using the InlineEditable aspect: ApplicationModel.ASPECT_INLINEEDITABLE)? I wish there was a way the same form would come up as read-only for users who do not have edit permission. Right now it shows the XML code instead.