Re: textfield error Parameter(s) 'translate' are required when displaying foreign field.
Tan, you need to register a translator for your own class in your tapestry module. Look at the javadocs for FieldTranslator ( http://tapestry.apache.org/tapestry5/apidocs/index.html), extend the FieldTranslatorImpl and you'll be in good shape. I think there was also a way to set up a tranlator in the page/component class itself if you name a method properly ( e.g. translateFromEmailAddress or something like that) but I don't recall the exact details. public static void contributeTranslatorDefaultSource( MappedConfiguration configuration) { configuration.add(EmailAddress.class, new EmailAddressTranslator()); configuration.add(PhoneNumber.class, new PhoneNumberTranslator()); } Cheers, Alex Kotchnev On Thu, Sep 11, 2008 at 9:05 PM, Tan [EMAIL PROTECTED] <[EMAIL PROTECTED]>wrote: > Hi, > > I'm newbie in tapestry, i have a problem when i want to show a foreign > field > value in textfield. it show me the error as below: > Parameter(s) 'translate' are required for > org.apache.tapestry5.corelib.components.TextField, but have not been bound. > > in java is: > > @Component(id = "Customer") > private Customer customer; > public Customer getCustomer() > { > return customer; > } > public void setCustomer(Customer customer) > { > this.customer = customer; > } > === > in tml is: > === > t:maxLenght="5" t:size="5" /> > === > > may i know how to solve this kind of problem? > *Remark: Customer field is a foreign field. > > Thank you. > > Regards, > Tan >
Re: textfield error Parameter(s) 'translate' are required when displaying foreign field.
Customer looks like an entity object. How would you present that as a single TextField? Tapestry doesn't know, either. On Thu, Sep 11, 2008 at 6:05 PM, Tan [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I'm newbie in tapestry, i have a problem when i want to show a foreign field > value in textfield. it show me the error as below: > Parameter(s) 'translate' are required for > org.apache.tapestry5.corelib.components.TextField, but have not been bound. > > in java is: > > @Component(id = "Customer") > private Customer customer; > public Customer getCustomer() > { > return customer; > } > public void setCustomer(Customer customer) > { > this.customer = customer; > } > === > in tml is: > === > t:maxLenght="5" t:size="5" /> > === > > may i know how to solve this kind of problem? > *Remark: Customer field is a foreign field. > > Thank you. > > Regards, > Tan > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
textfield error Parameter(s) 'translate' are required when displaying foreign field.
Hi, I'm newbie in tapestry, i have a problem when i want to show a foreign field value in textfield. it show me the error as below: Parameter(s) 'translate' are required for org.apache.tapestry5.corelib.components.TextField, but have not been bound. in java is: @Component(id = "Customer") private Customer customer; public Customer getCustomer() { return customer; } public void setCustomer(Customer customer) { this.customer = customer; } === in tml is: === === may i know how to solve this kind of problem? *Remark: Customer field is a foreign field. Thank you. Regards, Tan