hi anjali ,
coming to you problem:
first in your .page file you had a "model" parameter
associated with "timeZones" and in your java code it returns
"StringPropertySelectionModel" which implements "IPropertySelectionModel" .
But the thing you want to do is instead of returning hardcoded strings you
want to use .properties file.
Here is the way :-
We assume the following keys are in the .properties file
key1=Pacific Standard Time
key2=Central Standard Time
Do this in your java code:-
public IPropertySelectionModel getTimeZones() {
String a=getMessage(key1) ;
String b=getMessage(key2) ;
return new StringPropertySelectionModel(new String[] { a, b});
}
I hope it is clear now.....
Muralidhar Y
Software Engineer,
Adastrum technologies-Nikai groups,
EmiratesGroup-I.T Division,
Dubai, UAE.
Mobile : 00971-50-2256149.
http://www.adastrumtech.com
http://www.mercator.aero
(Keep Smiling. Be happy All The Time.)
-----Original Message-----
From: Anjali Abraham [mailto:[EMAIL PROTECTED]
Sent: 27 September 2005 18:11
To: [email protected]
Subject: How to get the localization for the PropertySelection
Hi,
Another question on localization.....
Well, I have in my html wherein I have a drop down, and that is being
implemented using PropertySelection.
How do I get the data's in my drop down in a localization using
Tapestry4???????
My html content is:
<tr>
<th class="text"><span jwcid="@FieldLabel"
field="ognl:components.timeZone" displayName="message:timeZone"/></th>
<td><select jwcid="timeZone"> </select></td> </tr>
My .page content:
<component id="timeZone" type="PropertySelection"> <binding name="model"
value="timeZones"/> <binding name="value" value="timeZone"/>
<binding name="displayName" value="message:timeZone"/>
</component>
My .Java code for the same is:
public IPropertySelectionModel getTimeZones() { return new
StringPropertySelectionModel(new String[] { "Pacific Standard Time",
"Mountain Standard Time", "Central Standard Time", "Eastern Standard
Time","Greenwich Mean Time"}); }
I know that I need to specify these values mentioned in this
StringPropertySelectionModel method need to be moved to my .properties
files... but how do I need to access these from my .properties file and
display that in my .html files.
Please respnd with solutions,
Thanks in advance,
Regards,
Anjali