I tried that, but it still doesn't work. It is working with listitempreview widget.
Is it possible to explicitly set label class to "mandatory"?

Dennis Dam wrote:
You don't see the "mandatory" mark because the label for the *subject* element is shown (which is not required!), instead of the *subjects* element (which you configured as required in business logic). If you put a 'required' validator on the subject element, does it solve the problem then ?


Slobodan Bogdanovic wrote:
Yes, it is displayed inside <group/> element.
Here is the part of layout

<template name="/document/meta">
<group type="column" class="container_box" width="100%" cellspacing="0" cellpadding="0">
        <macro-call id="commonMetaGroup"/>
        <macro-call id="specificMetaGroup"/>
    </group>
</template>

layout for this widget is defined in macro "commonMetaGroup".

and here is the part of generated html

<table class="group-column-table container_box" cellspacing="0" cellpadding="0" border="0" summary="">
<tbody>
 ...
<tr>
<td class="row-odd">
<label for="xxxxxxxxxxxxxxdocumentxxxxxxxxxxxxxxmetaxxxxxxxxxxxxxxcommonxxxxxxxxxxxxxxsubjectsxxxxxxxxxxxxxxsubject" title="">Subjects</label>
</td>
</tr>
<tr>
<td class="row-odd">
<span title="">
<select id="xxxxxxxxxxxxxxdocumentxxxxxxxxxxxxxxmetaxxxxxxxxxxxxxxcommonxxxxxxxxxxxxxxsubjectsxxxxxxxxxxxxxxsubject" class="selectgroup" size="5" name="xxxxxxxxxxxxxxdocumentxxxxxxxxxxxxxxmetaxxxxxxxxxxxxxxcommonxxxxxxxxxxxxxxsubjectsxxxxxxxxxxxxxxsubject" multiple="">
<option value="">Please select...</option>
<option selected="" value="1">Algemeen</option>
<option value="2">Test</option>
<option value="3">subject 3</option>
<option value="4">subject 4</option>
<option value="5">subject 5</option>
<option value="6">subject 6</option>
<option value="7">subject 7</option>
<option value="8">subject 8</option>
<option value="9">subject 9</option>
</select>
</span>
</td>
</tr>
...
</tbody>
</table>

Thanks,
Slobodan

Dennis Dam wrote:
Do you show the selectgroup widget inside a <group/> element ? Can you post the html which is rendered (or part of it) ?

Dennis

Slobodan Bogdanovic wrote:
Hi Dennis,

Only mandatory mark is missing. Document can't be saved without subjects selected.

Thanks for your feedback,
Slobodan

Dennis Dam wrote:
Hi Slobodan,

is just the mandatory mark missing, or is the field indeed not required: can you can save the document when have no subjects ?

regards,
Dennis

Slobodan Bogdanovic wrote:
Hi all,

I created few backend templates (cocoon forms) for HippoCMS and I can't make selectgroup widget mandatory. I only get selectgroup widget and label without mandatory mark. If I replace selectgroup listitempreview in layout.xml, listitempreview is displayed properly and it is marked as required.

Here are the snippets of my backend template:

schema:
-------
<xs:element name="subjects">
    <xs:complexType>
        <xs:sequence>
<xs:element name="subject" type="xs:string" use="required" minOccurs="1" maxOccurs="3"/>
        </xs:sequence>
    </xs:complexType>
</xs:element>


layout:
-------
<template name="/document/meta/common/subjects">
<selectgroup id="/document/meta/common/subjects/subject" size="5"/>
</template>

business logic:
---------------
<rule for="/document/meta/common/subjects">
<selectionsource src="repository://content/re-public/construction/subjects.xml" type="nodetree" cache="false"/>
        <validation>
            <validator name="required"/>
        </validation>       </rule>

How can I create selectgroup widget marked as mandatory? Is this a bug or I am missing something?

Thanks in advance,
Slobodan Bogdanovic
********************************************
Hippocms-dev: Hippo CMS development public mailinglist


********************************************
Hippocms-dev: Hippo CMS development public mailinglist


********************************************
Hippocms-dev: Hippo CMS development public mailinglist



--
Met vriendelijke groet / Kind regards,
Slobodan Bogdanovic
Software Developer
Levi9 Global Sourcing
===============================================================
Adress:    Jan van Goyenkade 8, 1075 HP Amsterdam
Tel.:      (+31) (0) 20 6701 947
Mobile:    (+381) (0) 64 2000 958
Email:     [EMAIL PROTECTED]
SkypeID:   slobodan.bogdanovic
Internet:  www.levi9.com

Chamber of commerce Levi9 Global Sourcing BV: 34221951
Chamber of commerce Levi9 Global Sourcing Benelux BV: 34224746
===============================================================
This e-mail may contain confidential or privileged information. If you
are not (one of) the intended recipient(s), please notify the sender
immediately by reply e-mail and delete this message and any attachments
permanently without retaining a copy. Any review, disclosure, copying,
distribution or taking any action in reliance on the contents of this
e-mail by persons or entities other than the intended recipient(s) is
strictly prohibited and may be unlawful.

The services of Levi9 are exclusively subject to its general terms and
conditions. These general terms and conditions can be found on
www.levi9.com and a copy will be promptly submitted to you on your
request and free of charge.
********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Reply via email to