You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by "Ian.Priest" <Ia...@opsera.com> on 2007/06/28 18:44:15 UTC

f:validator and "Undefined component type override"

I've hit a problem trying to set up a validator on an input text field.
Here's the HTML...

 

<div class="content"

      xmlns:t="http://myfaces.apache.org/tomahawk" 

      xmlns:h="http://java.sun.com/jsf/html"

      xmlns:f="http://java.sun.com/jsf/core">

 

            ...                             

            <h:inputText styleClass="x-large" size="20" maxlength="20"

                  value="#{@managed-bean-name.customer.user.username}"
id="username"

                  validator="#{@managed-bean-name.validateUsername}" 

                  required="true" >

 

<f:validator validatorId="com.scn.Regex" suppliedRegex="[A-Za-z0-9]*"

errorMessage="#{messages['customer.username_invalid_chars']}" />

            </h:inputText>

                                ...

 

And here's the error message....

 

2007-06-28 17:22:52,574 [http-8443-Processor23] ERROR
[org.apache.shale.clay.component.chain.CreateComponentCommand] Cannot
create Component renderId="997" jsfid="f:validator"
componentType="override" extends="f:validator" allowBody="null"
facetName="null"

javax.faces.FacesException: Undefined component type override

...

 

It works fine as-is, defined in component form like this...

 

      <component jsfid="widgetsValidatedInputText" extends="inputText">

            <attributes>

                  <set name="validator"
value="#{@managed-bean-name.@validateMethod}" />

            </attributes>

      </component>

      <component jsfid="widgetsRegexValidated"
extends="widgetsValidatedInputText">

            <validator jsfid="validateRegex">

                  <attributes>

                        <set name="suppliedRegex" value="@regex" />

                        <set name="errorMessage" value="@errorMessage"
/>

                  </attributes>

            </validator>

      </component>

 

But unfortunately I have a requirement to strip out the component layer
and use the JSF tags direct so I can't leave it as-is. (And I also
realise it's slightly unusual to have two validators).

 

Cheers,

Ian.