$wnd.location.href = locArray[0]+"?locale="+newLocale; Doesn't that reload the whole app ? The OP specifically asked a solution that didn't reload the whole app.
Cheers, Salvador On 14 mai, 14:13, Bhavik <bhavik...@gmail.com> wrote: > 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 Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---