Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: GXT 2.2.4 Combobox with paging loader popup disappear problem

  1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    79

    Default GXT 2.2.4 Combobox with paging loader popup disappear problem

    The combobox popup hides itself unexpectedly if to put combobox with the paging loader to the modal window.

    Here the example code which uses AdvancedComboboxExample sources. One thing is changed: trigger is not hidden.
    - To reproduce the issue run the example.
    - Start typing something until you will see the combo popup.
    - Select some value
    - Click on the combo trigger. Popup will be shown and hidden immediately.

    Code:
    public void test()
    {
        Window w = new Window();
        w.setModal(true);
        w.setSize(800, 400);
        w.add(new AdvancedComboBoxExample());
        w.show();
    }
    
    
    public class AdvancedComboBoxExample extends LayoutContainer
    {
    
    
        @Override
        protected void onRender(Element parent, int index)
        {
            super.onRender(parent, index);
            String url = "http://www.extjs.com/forum/topics-remote.php";
            ScriptTagProxy<PagingLoadResult<ModelData>> proxy = new ScriptTagProxy<PagingLoadResult<ModelData>>(
                    url);
    
    
            ModelType type = new ModelType();
            type.setRoot("topics");
            type.setTotalName("totalCount");
            type.addField("title", "topic_title");
            type.addField("topicId", "topic_id");
            type.addField("author", "author");
            type.addField("excerpt", "post_text");
    
    
            DataField date = new DataField("lastPost", "post_time");
            date.setType(Date.class);
            date.setFormat("timestamp");
            type.addField(date);
    
    
            JsonPagingLoadResultReader<PagingLoadResult<ModelData>> reader = new JsonPagingLoadResultReader<PagingLoadResult<ModelData>>(
                    type);
    
    
            PagingLoader<PagingLoadResult<ModelData>> loader = new BasePagingLoader<PagingLoadResult<ModelData>>(
                    proxy, reader);
    
    
            loader.addListener(Loader.BeforeLoad, new Listener<LoadEvent>()
            {
                public void handleEvent(LoadEvent be)
                {
                    be.<ModelData> getConfig().set("start",
                            be.<ModelData> getConfig().get("offset"));
                }
            });
    
    
            ListStore<ModelData> store = new ListStore<ModelData>(loader);
    
    
            ComboBox<ModelData> combo = new ComboBox<ModelData>();
            combo.setWidth(580);
            combo.setDisplayField("title");
            combo.setItemSelector("div.search-item");
            combo.setTemplate(getTemplate());
            combo.setStore(store);
            // combo.setHideTrigger(true);
            combo.setPageSize(10);
    
    
            VerticalPanel vp = new VerticalPanel();
            vp.setSpacing(10);
    
    
            vp.addText("<span class='text'><b>Combo with Templates and Ajax</b><br>This is a more advanced example that shows how you can combine paging, XTemplate and a remote data store to create a 'live search' feature.</span>");
            vp.add(combo);
    
    
            add(vp);
        }
    
    
        private native String getTemplate() /*-{
            return [
                    '<tpl for="."><div class="search-item">',
                    '<h3><span>{lastPost:date("MM/dd/y")}<br />by {author}</span>{title}</h3>',
                    '{excerpt}', '</div></tpl>' ].join("");
        }-*/;
    }
    - GXT version: 2.2.4
    - Host mode / web mode / both: host mode (didn't test other)
    - Browser and version: FF 5.0, Chrome dev build
    - Operating System: Windows 7

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    Why do you thing this is a bug? Have you only used this backend or have you tested this against any backend?

    I debugged the code and its doing exactly what it should do if you keep the serverresponse in mind

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    79

    Default

    The thing is that in not modal window the behaviour is different. Popup never closes itself.
    I've tried to use such combobox in modal window and didn't know why it hides popup after the query and doesn't allow me to select the value. While debugging i found that unexpected triggerBlur event is called. And only then i found that the reason was the combobox is in modal window.
    Is there any way to use such combobox in modal window?

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    I am running the latest GXT svn version and it behaves exactly the same in a modal or non modal window

  5. #5
    Sencha User
    Join Date
    Mar 2011
    Posts
    79

    Default

    So there are no popup disappearing there?

  6. #6
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    The list collapses, which is correct, as the server returns 0 results

  7. #7
    Sencha User
    Join Date
    Mar 2011
    Posts
    79

    Default

    But what happens if you press trigger second time?

  8. #8
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    It does not expand. And also this is correct. Because queryCache is enabled and the query is still again, it is not going to the server again

  9. #9
    Sencha User
    Join Date
    Mar 2011
    Posts
    79

    Default

    I will try to provide better example because when i work with custom data even if list is not empty it hides the popup unexpectedly. Then i press trigger second time popup is shown and i can select the value.

  10. #10
    Sencha User
    Join Date
    Mar 2011
    Posts
    79

    Default

    Sorry for wasting of your time. The reason was in my code.
    I have a status indicator which is shown on each DispatchCallback
    Code:
    #status {
        position: absolute;
        z-index: 2147483645;
        left: 0px;
        top: 0px;
        right: 0px;
        bottom: 0px;
        filter: alpha(opacity = 40);
        opacity: 0.4;
        text-align: center;
        background-color: black;
    }
    .status-indicator {
        position: absolute;
        left: 49%;
        top: 40%;
    }
    <div id="status" style="visibility: hidden">
        <div class="status-indicator">
        <img src="gxt/images/default/shared/large-loading.gif"/>
        </div>
    </div>
    Seems that when paging combobox makes a request to server in modal window there is a some z-index conflict which causes combo popup closing. However it happens only in modal window.

    I don't know how to fix it yet. I only know that if i don't show loading status the issue is absent.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •