[opencms-dev] OpenCms 8.5: Why is the CategoryWidget a required field by default?

Schliemann, Kai K.Schliemann at comundus.com
Wed Jan 23 14:04:56 CET 2013


Hi Tobias,
thanks for your answer.
good point.
BUT:

1.       I defined several other fields (e.g. OpenCmsString fields) in the same way. They are not marked in red color and I can still save my file and the values are saved as well.

2.       I haven't defined a validation rule. So I expect OpenCms to save the field without error, because the element exists, it is just empty.
So I stick to my opinion, that this seems to be a bug.

Am I right or wrong?

Best regards
Kai



Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von Tobias Karrer
Gesendet: Mittwoch, 23. Januar 2013 12:37
An: The OpenCms mailing list
Betreff: Re: [opencms-dev] OpenCms 8.5: Why is the CategoryWidget a required field by default?

Default is minOccurs="1" and maxOccurs="1" so
<xsd:element name="TopTeaser" type="OpenCmsCategory" minOccurs="1" maxOccurs="1" />
in your case.

Try
<xsd:element name="TopTeaser" type="OpenCmsCategory" minOccurs="0" />

Regards,
Tobias

Am 23.01.2013 11:17, schrieb Schliemann, Kai:

Hi list,

I found a strange behavior while using the CategoryWidget in my schema.

First of all, this is how my schema looks like:

...

<xsd:element name="TopTeaser" type="OpenCmsCategory" />

...

<layout element="TopTeaser" widget="CategoryWidget" configuration="category=agencies/" />

...

<validationrules/>

...



As you can see, the element is not defined as required field.

Nevertheless, OpenCms marks this field as required (the label of the field is in red color).



The most disturbing thing is, that I can save and close the file without a further warning.

BUT, if I do not select a category in this field, the whole content is not saved.



This behavior can't be intentional. I assume, this is a bug.

Can anybody confirm this behavior or give me hint on how to solve this issue?



Thanks in advance.



Regards

Kai




_______________________________________________

This mail is sent to you from the opencms-dev mailing list

To change your list options, or to unsubscribe from the list, please visit

http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20130123/8f6bdd28/attachment.htm>


More information about the opencms-dev mailing list