Call URL via a ListBox change handler

2009-10-12 Thread Dariusz

I have a problem setting the locale via a ListBox behaviour.

Let's take this example:

public class GWTClient implements EntryPoint,ChangeHandler {
  ListBox list = new ListBox();

  public void onModuleLoad() {

list.setVisibleItemCount(10);
list.setMultipleSelect(true);

list.addItem(A);
list.addItem(B);
list.addItem(C);
list.addItem(D);

list.addChangeHandler(this);

RootPanel.get().add(list);
  }
  public void onChange(Widget sender) {
if (sender == list) {
  // here it should update the url to '?locale=en'
}
  }
}

I tried already

Window.Location.assign( ?locale=en );

It's working in FF but not in IE.

Appreciate for any hints, examples or solutions.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Call URL via a ListBox change handler

2009-10-12 Thread Thomas Broyer



On 12 oct, 11:07, Dariusz darius...@gmail.com wrote:
 I tried already

 Window.Location.assign( ?locale=en );

 It's working in FF but not in IE.

 Appreciate for any hints, examples or solutions.

Assuming you want to entirely replace the query-string:
Window.Location.assign(Window.Location.getPath() + ?locale=en);

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Call URL via a ListBox change handler

2009-10-12 Thread Dariusz

Thomas,

Thanks! That's it! It works! :-)



On Oct 12, 3:03 pm, Thomas Broyer t.bro...@gmail.com wrote:
 On 12 oct, 11:07, Dariusz darius...@gmail.com wrote:

  I tried already

  Window.Location.assign( ?locale=en );

  It's working in FF but not in IE.

  Appreciate for any hints, examples or solutions.

 Assuming you want to entirely replace the query-string:
 Window.Location.assign(Window.Location.getPath() + ?locale=en);
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---