Hello Friends,
I too recently had the same problem as yours. My requirement was a
user can change the language on his wish from the ComboBox.
So the solution I did with is I used JSNI (JavaScript Native
Interface). - Javascript to be written into Java file.
I put a combox. and on its "onSelect()" method in Listener Method of
ComboBox, I get the value like "en_US" or "fr_FR" like this....
Then I created an innerclass and created a JSNI method named
changeLocale like :
class Locale
{
private native void changeLocale(String newLocale)/*-{
//alert("Language changed to : "+newLocale);
var currLocation = $wnd.location.toString();
//alert("currLocation : "+currLocation);
var noHistoryCurrLocArray = currLocation.split("#");
//alert("noHistoryCurrLocArray: "+noHistoryCurrLocArray);
var noHistoryCurrLoc = noHistoryCurrLocArray[0];
//alert("noHistoryCurrLoc : "+noHistoryCurrLoc);
var locArray = noHistoryCurrLoc.split("?");
//alert("locArray : "+locArray);
$wnd.location.href = locArray[0]+"?locale="+newLocale; //$wnd
}-*/;
}
Now in onSelect() method of Combobox create an instance of Locale and
then call the changeLocale() native method.
Good Luck. This will work as I did the same......
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---