>Hi > >Ok, I am ready to submit the patch for this. However there are som issues that >need to be dealt with before I submit. > >1. The tool now adds a validator attribute to each component if one is defined >for the tld it self (It is a separate entry in the tld apart from the tags >them >self) > > <component jsfid="hx:commandExButton" > componentType="com.ibm.faces.HtmlCommandExButton" > validator="com.ibm.faces.taglib.JWLTagLibraryValidator" > extends="baseComponent"> > >There is a problem with the dtd for the Clay components here: > ><!ELEMENT component (description*, attributes?, symbols?, converter?, ,*, >actionListener*, valueChangeListener*, element*)> ><!ATTLIST component jsfid CDATA #REQUIRED > extends CDATA #IMPLIED > componentType CDATA #IMPLIED > id CDATA #IMPLIED > allowBody %Boolean; #IMPLIED > facetName CDATA #IMPLIED >> > >Even though it is stated in the comment above the declaration : >... > validator - A component can have zero or many associated validators. Only >components that > implement the EditableValueHolder interfaces can be assigned validators. > This >rule > is enforced at runtime and not through this document type definition. >.. >It is not defined in the component it self. Also since the jsf dtd only >specifies a single validator declaration, there is no way that the Clay >compenent definition that maps jsf component libraries can have more than one >validator assigned. >
That's not exactly correct. A componnet can contain any number of validators but the "jsfid" has to be unique. This has more to do with how inheritance is resolved. One component definition can extend another inheriting validators. You can add or override validators in the sub component definition by "jsfid". However, are you saying that "validator*," will not support multiple validators? Consider: <component jsfid="email" extends="inputText" id="email"> <attributes> <set name="value" value="[EMAIL PROTECTED]" /> <set name="size" value="30" /> <set name="maxlength" value="50" /> <set name="required" value="false" /> </attributes> <validator jsfid="val:commonsValidatorRequired"> <attributes> <set name="client" value="true" /> <set name="server" value="true" /> <set name="arg" value="#{messages['rolodex.email']}" /> </attributes> </validator> <validator jsfid="val:commonsValidatorEmail"> <attributes> <set name="client" value="true" /> <set name="server" value="true" /> <set name="arg" value="#{messages['rolodex.email']}" /> </attributes> </validator> </component> > >2. Regarding converters, I have skimmed through the trinidad stuff and the >only >reference to converters are as attributes to the tags: > <attribute> > <name>converter</name> > <rtexprvalue>false</rtexprvalue> > <description>a converter object</description> > </attribute> > >The converters are now mapped as attributes to the Clay components: > > <set name="converter" bindingType="MB"></set> > Trinidad has a few custom converters. I think I have them all covered in the shale-clay-trinidad project in the sandbox. Search for "tr:convertColor" in the clay config [1]. [1] http://svn.apache.org/viewvc/shale/sandbox/shale-clay-trinidad/src/main/resources/META-INF/tr-incubator-m1-SNAPSHOT-config.xml?view=markup >3. The rendererType is also mapped as an attribute: > > <set name="rendererType" value="com.ibm.faces.Button"></set> > Sound perfect. > >Hermod -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, January 29, 2007 9:12 AM To: dev@shale.apache.org Subject: RE: svn commit: r500112 -/shale/sandbox/maven/archetypes/shale-clay-starter-archetype/src/main/r esources/archetype-resources/src/main/webapp/WEB-INF/validator-rules.xml Hi I had already done the rendererType, but was waiting to file a Jira on it until I had added the converters and validators. Since you hav done something here, could you send it to me and I'll look at it. Hermod