[opencms-dev] Validation issue for Nested Type

Tobias Karrer kartobi at gmail.com
Tue Jul 21 10:30:49 CEST 2015


Hi Ashish,

you need to move the validation rule for your nested element to the 
included .xsd, so in the same file where <xsd:element name="Text" 
type="OpenCmsString" /> is defined.

Best,
Tobias

Am 21.07.2015 um 08:01 schrieb Ashish Shekhar:
> Validation issue for Nested Type
>   Hi,
>
> I am setting validation rule for elements which are under tab.
>
> One tab contains Nested elements for which I am trying to set the
> validation rule.
>
> Validation are working fine for all elements under tab but validation for
> element for nested is not working.
>
> The default value for the nested element is working fine but validation
> seems not working.
>
> Can you please help on this? What could be the issue?
>
>
> <resourcebundle name="my.template.workplace" />
>              <tabs>
>                  <tab element="Heading" collapse="false" name="General" />
>                  <tab element="Author" collapse="false" name="Author" />
>                  <tab element="SubMainContent" collapse="true"
> name="SubMain" />
>              </tabs>
>              <defaults>
>                  <default element="SubMainContent/Title"
> value="%(key.title.oceanofsky)" />
>              </defaults>
>               <validationrules>
>                  <rule element="Heading" regex=".+" type="error"
> message="heading must not be empty." />
>                  <rule element="Author" regex="\w{3,}.{0,}" type="error"
> message="Author name must start with at least 3 characters."/>
>                  <rule element="SubMainContent/Text" regex=".+" type="error"
> message="heading must not be empty." />
>   </validationrules>
>
> -Ashish
> _______________________________________________
> 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/20150721/109aa7e7/attachment.htm>


More information about the opencms-dev mailing list