[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.webtools.jsf] Re: Validation: containment-constraint

The constraint doesn't stop from doing anything. Rather, the tag should be marked with a warning that it is not instead your form tag when you run validation (i.e. when you right click on the jsp and select "Validation"). Do you not see this error message?


Thanks,

Cameron

shilpa wrote:

Cam,

The Containment constraint doesn't seem to work for me when I have written a plugin for my custom tag library. Even if I mention a constraint of say actionButton to be inside a form, it still allows me to put an action button outside a form.
My metadata looks like this - <?xml version="1.0" encoding="UTF-8"?>
<md:metadatamodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore";
xmlns:md="http://org.eclipse.jst.jsf.common.metadata/metadata.ecore";


xmlns:mdt="http://org.eclipse.jst.jsf.common.metadata/metadataTraitTypes.ecore";
xmlns:cnst="http://org.eclipse.jst.jsf.core/constraints.ecore"; xmlns:qe="http://org.eclipse.jsf.pagedesigner/QuickEditTabSections.ecore";
id="http://esf.hsbc.com/tags/jhx"; type="tagFile">
<!-- Action Button Starts -->
<entity id="actionButton" type="tag">
<include-entity-group id="common-attributes" />
<include-entity-group id="basic-jhx-common-attributes" />
<trait id="containment-constraint">
<value xsi:type="cnst:ContainsTagConstraint">
<set-generator>
<algorithm>xpath</algorithm>
<expression>ancestor::*</expression>
</set-generator>
<satisfies-set>
<tagId>
<uri>http://esf.hsbc.com/tags/jhx</uri>
<name>form</name>
</tagId>
</satisfies-set>
</value>
</trait>



Do u see any problem in this ???