[opencms-dev] OpenCms 8.5.0: UPDATE validation rule for nested element

Schliemann, Kai K.Schliemann at comundus.com
Fri Jan 25 12:45:49 CET 2013


Hi list,

I further investigated the problem and found out, that as long as I am typing in the field and as long as the regexp is not matched, the box is highlighted in red. As soon as I leave that field and go on to another field, the field reverts its color to its normal state. As so, I can no longer see, that the entered text is in the wrong format. I hope, that this is not the intended behavior. In my opinion, that is very confusing.

Furthermore, the workaround described below with minOccurs="1" does not work with a nested elements.

-----------------------------
Original message below:

it seems that there is another problem with the validation rules in OpenCms 8.5.0.

In my schema I defined the following:
...
<xsd:element name="Email" type="OpenCmsString" />
...
<rule element="Email" regex=" ^(([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?))?$" type="error" message="Error message" />
...

The validation rule does not work.
If I define my element with minOccurs="1" the validation rule works as expected.
<xsd:element name="Email" type="OpenCmsString" minOccurs="1" />
If I am not mistaken, minOccurs="1" is the default value, so I should be able to omit it.

I am not sure, if this bug is already fixed with issue #84 (https://github.com/alkacon/opencms-core/issues/84) so I am mentioning it here.

Does anybody else have the same problem or can confirm this as a bug?

Thanks in advance.
Regards
Kai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 7761 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20130125/36be468c/attachment.bin>


More information about the opencms-dev mailing list