Yes, I know this is probably not possible, but I would like to use my 
application-wide SimpleDateFormat for formatting all date displays, both 
static text (using @Insert) and in form fields (using @DatePicker).

In my base page implementation, I have a getter that will return a 
SimpleDateFormat instance with a format of "dd MMM yyyy":

public Format getDateFormat() {
        ...
}

In my .page files, I can use this with @Insert components like this:

    <component id="creationDate" type="Insert">
        <binding name="value" value="subscription.creationDate"/>
        <binding name="format" value="ognl:dateFormat"/>
    </component>

I would also like to use/reference the same SimpleDateFormat instance from 
within my DatePicker components in place of the usual sytax:

        <binding name="translator" value="translator:date,pattern=yyyy-mm-dd"/>

 I have tried things like the following, but the date values still seem to 
come out using the default locale's format:

    <component id="expirationDate" type="DatePicker">
        <binding name="value" value="subscription.expirationDate"/>
        <binding name="translator" value="translator:date"/>
        <binding name="format" value="ognl:dateFormat"/>
        <binding name="pattern" value="ognl:dateFormat"/>
    </component>

Basically, I would like to set the translator's 'pattern' attribute from 
within my component desigation to be the value of the ognl expression 
'dateFormat' (or the toString equivalent).

Is there a way to do this that I'm just not clever enough to figure out?

Thanks,
jason
-- 
Jason L. Buberel -- [EMAIL PROTECTED] -- www.buberel.org
+1.650.483.1989  -- jabber:[EMAIL PROTECTED]

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

Reply via email to