Hi Muralidhar,
        Well I have understood your explanation. Thanks for explanating so
well.
        As I am using Tapestry4.0beta4.0 version, and in that
getMessage("Key") is being deprecated.... and also I am extending my java
class from BasePage.
So how do I go about it....????
Please respond with solution,
Thanks in advance,
        

Regards,
Anjali

-----Original Message-----
From: Muralidhar Y. [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 28, 2005 9:07 AM
To: 'Tapestry users'
Subject: RE: How to get the localization for the PropertySelection

 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
 

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

Reply via email to