>From: Daniel del Río <[EMAIL PROTECTED]> 
>
> Hello, 
> I have a problem with the timezone attribute in a "convertDateTime" 
> component. The clay-config looks like: 
> 
>...
>    <component jsfid="iniciColumn" extends="column" id="inici">
>        <element renderId="1" jsfid="outputText">
>            <attributes>
>                <set name="value" value="#{t.dataInici}" />
>                <set name="immediate" value="true"/>
>            </attributes>
>            <converter jsfid="convertDateTime">
>                <attributes>
>                    <set name="pattern" value="dd/MM/yy, HH:mm" />
>                    <set name="timeZone" value="GMT+01" />
>                </attributes>
>            </converter>
>        </element>
>    </component>
>...
>
>
> 
> I get the following error: 
> 
> javax.faces.convert.ConverterException: You have requested a conversion for 
> type java.util.TimeZone, but there is no by-type converter registered for 
> this type 
> 
> I use the last version of shale, someone have detected the same problem or 
> knows what is wrong? 
> 

This is a bug.  Please create a JIRA issue 
(http://issues.apache.org/struts/secure/Dashboard.jspa).


The attributes are pushed to the component using a handy utility, 
"org.apache.shale.util.ConverterHelper", that  uses the JSF converters to 
handle changing the string type to the target property value.  There is not a 
JSF converter registered for the TimeZone class.  

There is another way to handle this but I think the best option is to add a 
TimeZone converter.  You can register your own common chains command to handle 
creating the target JSF components.  

http://svn.apache.org/viewvc/struts/shale/trunk/shale-clay/src/main/resources/org/apache/shale/clay/component/chain/shale-clay-config.xml?view=log

There is a "PluggableLookupCommand" that looks for custom commands registered 
in the "clayCustomization" catalog.   You can register your custom catalog 
using the context listener in the web.xml.  

<command className   = "org.apache.shale.clay.utils.PluggableLookupCommand"
             catalogName = "clayCustomization"
             name        = "preprocessAddConverter"
             optional    = "true"/>

I won't go into the details here because I don't think you should have to do 
anything special for one of the runtime converters but thought it would be 
worth mentioning.  


Gary




> bye. 
> 
> 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 

Reply via email to