[CLOSED] Combo box items not loading on store reload.

  1. #1

    [CLOSED] Combo box items not loading on store reload.

    Hi,

    I have a combo box, for which I have a store defined in advance in the .aspx page.

    I bind ajax proxy data to the combo box store. Always, initially, the store is empty...as there is no data.

    Once i load the page, I have a button that pops up a window. In that button click event to pop up that window, I reload combo cox with store parameter and show it on that window.

    So, the problem is that at first shot, on that window, when i click combo box, nothing is loaded. I then close the window and when i reopen it, i am seeing the combo box loaded with items now...

    It is really wierd that it is not loading items at first shot.

    Can you pls let me know how I can fix this ?

    Appreciate if you can provide me a response soon !

    Thanks,
    Veda
    Last edited by Daniil; Aug 20, 2013 at 9:14 AM. Reason: [CLOSED]
  2. #2
    Hi Veda,

    Could you, please, provide us with a test case?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi Veda,

    Could you, please, provide us with a test case?
    Hi,

    pls find the code provided below.
    I have a combo box on the window. The store for this combo box is defined below. Initially I send the parameter value as "EMPTY" only to have empty store first.
    Later in some part of code, I have commandcolumn for grid, where the Direct method -"ChangeComponent" is called on clik of the Edit button. In this direct method, I reload this "MuseumTargetPTstore" store and then show the window on screen. Here is where, I am unale to see items on the combo box when i select it.

    
                           <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
          <ext:Store runat="server" ID="MuseumTargetPTstore" AutoLoad="true">
            <Proxy>
                <ext:AjaxProxy Json="true" Url='<%#TargetPlatformURL%>' AutoDataBind="true" >
                    <ActionMethods Read="POST" Create="POST"/>     
                                     <Headers>
                                     
                                     <ext:Parameter Name="Accept" Value="application/json" />
                                     <ext:Parameter Name="Content-Type" Value="application/json" />
                                     
    
                                     </Headers>                       
                                <Reader>
                                    <ext:JsonReader Root=""/>
                                </Reader>
                                <Writer>
                                <ext:JsonWriter Root="" Encode="true"/>                            
                                </Writer>
                                  <ExtraParams> 
                                <ext:StoreParameter Name="PlatformType" Value="EMPTY"/>  
                                </ExtraParams>
    
    
                </ext:AjaxProxy>
            </Proxy>
            <Model>
                <ext:Model ID="Model7" runat="server" IDProperty="PLATFORM_ID">
                    <Fields>
                        <ext:ModelField Name="PLATFORM_ID" Type="Int" />
                        <ext:ModelField Name="PLATFORM_TYPE" Type="String" />
                        <ext:ModelField Name="TARGET_PLATFORM" Type="String" />                   
                        
                       
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>              
    .
    ..
    
    <ext:Window ID="window1" runat="Server" Hidden=>
    <ext:ComboBox runat="Server" ID="Combo1" StoreID="MuseumTargetPTstore">
    .
    .
    .
    </ext:ComboBox>       
    
       
    
    .
    .
    .
    <ext:GridPanel runat="Server">
    .
    .
    .
    
     <ColumnModel ID="ColumnModel4" runat="server">
                                    <Columns>
                                    
                                        <ext:Column ID="Column16" runat="server" Text="TAMS ID" Width="50" DataIndex="TAMS_ID" />
                                        <ext:Column ID="Column17" runat="server" Text="Component Name" DataIndex="COMPONENT_NAME" />
                                        <ext:Column ID="Column18" runat="server" Text="Host Name" Width="80" DataIndex="HOSTNAME" />
    
                                        <ext:CommandColumn ID="CommandColumn1" runat="server" Width="110">
                            <Commands>
                            <ext:GridCommand Icon="NoteEdit" CommandName="Edit" Text="Edit" />
                            <ext:CommandSpacer Width ="60" />
                                <ext:GridCommand Icon="Delete" CommandName="Delete" Text="Delete" />
                                
                            </Commands>
                            
                            <Listeners>
                                <Command Handler="App.direct.ChangeComponent(command,record.get('MUSEUM_ID'),record.get('PRODUCT_TYPE'));" />
                            </Listeners>
                        </ext:CommandColumn>
    </Columns>
    </ColumnModel>
    </ext:GridPanel>
    
    
    Code behind file:
    
      public void ChangeComponent(string CommandType, string MuseumID, string ProductType)
            {
    
      MuseumTargetPTstore.Reload(new Ext.Net.ParameterCollection()
                    {
                        new Ext.Net.Parameter("PlatformType",ProductType) 
          
                    });
    
    .
    .
    .
    window1.show();
    }
    Pls help me resolve this.
    Thanks,
    Veda
    I
  4. #4
    Thank you.

    When you click a ComboBox's trigger very first time, it loads its Store. So, your .Reload() call gets reset.

    I can suggest the following.

    1. Remove the AjaxProxy's ExtraParams.

    2. Change AutoLoad="true" to false. It seems better not load the Store at all, than load nothing to it.

    3. Set up the following for the Store:
    <ext:Store>
        <Parameters>
            <ext:StoreParameter 
                Name="PlatformType" 
                Value="this.platformType" 
                Mode="Raw" 
                Action="read" />
        </Parameters>
    </ext:Store>
    "this" is a Store instance.

    4. Change it on the fly in JavaScript:
    App.MuseumTargetPTstore.platformType = record.get('PRODUCT_TYPE');
    within the CommandColumn's Command listener or in code behind.
    MuseumTargetPTstore.Set("platformType", ProductType);
    If something doesn't work again, please provide a full and runnable test case.
  5. #5
    Quote Originally Posted by Daniil View Post
    Thank you.

    When you click a ComboBox's trigger very first time, it loads its Store. So, your .Reload() call gets reset.

    I can suggest the following.

    1. Remove the AjaxProxy's ExtraParams.

    2. Change AutoLoad="true" to false. It seems better not load the Store at all, than load nothing to it.

    3. Set up the following for the Store:
    <ext:Store>
        <Parameters>
            <ext:StoreParameter 
                Name="PlatformType" 
                Value="this.platformType" 
                Mode="Raw" 
                Action="read" />
        </Parameters>
    </ext:Store>
    "this" is a Store instance.

    4. Change it on the fly in JavaScript:
    App.MuseumTargetPTstore.platformType = record.get('PRODUCT_TYPE');
    within the CommandColumn's Command listener or in code behind.
    MuseumTargetPTstore.Set("platformType", ProductType);
    If something doesn't work again, please provide a full and runnable test case.
    Hi Daniil,

    Thanks a lot for your response...I added the property "QueryMode="local" to combo box and it worked.

    Thanks,
    Veda

Similar Threads

  1. Replies: 1
    Last Post: Jun 18, 2013, 3:56 PM
  2. [CLOSED] Combo query issue when using same store on two combo boxes
    By FpNetWorth in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 05, 2013, 10:53 PM
  3. [CLOSED] Store Load-handler cant reload child store
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 04, 2011, 7:56 AM
  4. [CLOSED] Add Combo items
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 23, 2010, 1:00 PM
  5. Force combo to reload data?
    By plykkegaard in forum 1.x Help
    Replies: 2
    Last Post: Jan 05, 2010, 11:00 AM

Tags for this Thread

Posting Permissions