Thanks for help! Works fine ;) -----Original Message----- From: Shing Hing Man [mailto:[EMAIL PROTECTED] Sent: Thursday, December 29, 2005 3:22 PM To: Tapestry users Subject: Re: DatePicker: Translating date
> <component id="quoteDateValue" type="Insert"> > <binding name="value" > value="ognl:quoteDateValue"/> > <binding name="translator" > value="translator:pattern=yyyy-MM-dd"/> > </component> You can use the format parameter of an Insert component to format the output. Details could be found at http://jakarta.apache.org/tapestry/tapestry/ComponentReference/Insert.html In your .page, try something like this : <property name="dateFormater" initial-value="new java.text.SimpleDateFormat('yyyy-MM-dd')"/> <component id="quoteDateValue" type="Insert"> <binding name="value" value="ognl:quoteDateValue"/> <binding format="ognl:dateFormater/> </component> Shing --- Schabek £ukasz <[EMAIL PROTECTED]> wrote: > > Hi! > > I have problem with translating date in result page using DatePicker > On main page i have DatePicker component declared like this: > > main.html: > ============ > <span jwcid="quoteDate" type="text" > class="FormText">May 3, 2005</span> > ============ > main.page: > ============ > <page-specification class="com.tpsa.ADLog2.Main"> > <component id="quoteDate" type="DatePicker"> > <binding name="value" value="quoteDate"/> > <binding name="translator" > value="translator:date,pattern=yyyy-MM-dd"/> > </component> > </page-specification> > ============ > Main.class: > ============ > public abstract class Main extends BasePage { > @InjectPage("User") > //... > public abstract Date getQuoteDate(); > //... > public IPage onOk(IRequestCycle cycle) { //... > String quoteDateValue = > getQuoteDate().toString(); > //... > =========== > User.java > =========== > public abstract class User extends BasePage{ //... > public abstract void setQuoteDateValue(String quoteDateValue); } > =========== > > Date has wright pattern yyyy-MM-dd. After submit i've got date in > format: > Fri Dec 30 00:00:00 CET 2005 > > The OGNL component in html file is defined like > this: > User.html: > =========== > <span jwcid="[EMAIL PROTECTED]" > value="ognl:quoteDateValue"/> > =========== > I've tried to define quoteDateValue component in page file but it's > generate error - can't parse translator > User.page: > =========== > <component id="quoteDateValue" type="Insert"> > <binding name="value" > value="ognl:quoteDateValue"/> > <binding name="translator" > value="translator:pattern=yyyy-MM-dd"/> > </component> > =========== > > How can I translate output date to yyyy-MM-dd pattern ? > > Sorry for my bad english ;) > > > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Home page : http://uk.geocities.com/matmsh/index.html ___________________________________________________________ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
