pkt1583 / gwt-ext

Automatically exported from code.google.com/p/gwt-ext
0 stars 0 forks source link

ComboBox setStore() problem #446

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I've implemented an RPC service , as following :

- on the client-side, I've defined two interfaces, MyService (that extends
RemoteService ) and MyServiceAsynch. Within MyService i have a method with
the signature : public String[][] getQuestions();
- on the server-side I have the implementation class of MyService; the
method getQuestions() returns some records from the database;

2.I have a ComboBox object that gets populated using a SimpleStore object,
which I have constructed from the result returned by the server-side code,
in the following way :

      final ComboBox box = new ComboBox("Options");

      MyServiceAsync svc = (MyServiceAsync)GWT.create(MyService.class);

      ServiceDefTarget endPoint = (ServiceDefTarget)svc;

      endPoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "/myService");

      AsyncCallback callback = new AsyncCallback(){

            public void onFailure(Throwable caught) {
                RootPanel.get().add(new HTML(caught.toString()));           
            }

            public void onSuccess(Object result){
                Store store = new SimpleStore(
                        new String[] { "id", "question" }, (String[][]) result);
                box.setStore(store);
                box.setForceSelection(true);
                box.setEditable(false);
                box.setAllowBlank(false);
                box.setFieldLabel("sq1");
                box.setDisplayField("question");
                box.setEmptyText("Pick a question");
                box.setLoadingText("Loading...");
                box.setSelectOnFocus(true);
                box.setWidth(350);
                RootPanel.get().add(box);

            }         
       };          

       svc.getQuestions(callback);

3. I have tested this piece in a standalone project,created using the
applicationCreator command and it works perfectly fine, the content comes
from the server and gets displayed.

4. When I've integrated this in a larger project( i.e. : i added the
ComboBox in a Porlet which is included in my entry-point class), it didn't
work anymore.

What is the expected output? What do you see instead?

I expected the combobox to be populated with that data. Instead, this is
what hapens : I call the setStore() method and after that the call of
box.getStore() returns null. Also, the "result" object that comes from the
server is not empty,and it contains exactly what it's supposed to.

The project that I integrated this in uses Maven 2.0.9 to compile the GWT
code and JBoss 4.2.3 as application server.

What version of the product are you using? On what operating system?
I'm using gwt 1.5.2, gwt-ext 2.0.5, Windows XP, Mozilla 2.0

Please provide any additional information below.

Original issue reported on code.google.com by DenisaMotoc@gmail.com on 23 Oct 2008 at 2:23