1. #1
    Sencha User francescoNemesi's Avatar
    Join Date
    Apr 2007
    Location
    London (UK), Milan (ITA)
    Posts
    148
    Vote Rating
    0
    francescoNemesi is on a distinguished road

      0  

    Default ComboBox, force query execution

    ComboBox, force query execution


    Hi there,

    I have created a subClass of ComboBox which uses a proxy, a loader and a PagingToolBar. The ComboBox is used to select numeric codes. When a user types in, say, "12" a service goes to the server and retrieves all codes starting in "12" depending on another condition, i.e. the clients associated to the ites whose value starts with "12". Now the user change this condition and then again type "12" in the combo box expecting to retrieve all the numeric codes starting in "12" for the new condition.

    The problem I am having is that, having already typed "12" in the combo box, when I type "12" again, the combo box does not call the service again and hence show me the numeric codes for the first condition, not the ones for the second, new, condition. There is a caching mechanism that I would like to override when the condition changes. I am pretty sure it is as easy as calling a method or setting a property somewhere, but I don't know where.

    Any ideas? Thanks for your help,
    Francesco

    Below is my code for reference.

    Code:
    public class ClienteComboBox extends ComboBox<ClientBmd>{
    	
    	private MyService myService = (MyService)GWT.create(MyService.class) ;
    	private static ListStore<ClientBmd> clientsStore;
    	private static PagingLoader<PagingLoadResult<ClientBmd>> loader;
    	private static ApplicationModel applicationModel;
    	private static PagingToolBar pagingBar;
    
    	private static final int pageSize = 10;
    	
    	private static final String toolTipText = "A Tooltip";
    	
    	public ClienteComboBox() {
    		
    		applicationModel = ApplicationModel.getInstance();	
    		
    		addSelectionChangedListener(new SelectionChangedListener<ClientBmd>(){
    			@Override
    			public void selectionChanged(SelectionChangedEvent<ClientBmd> se) {
    				applicationModel.setClient(se.getSelectedItem().getClient(), true);
    			}
    		});
    		
    		RpcProxy<PagingLoadResult<ClientBmd>> proxy = new RpcProxy<PagingLoadResult<ClientBmd>>() {  
    			@Override
    			protected void load(Object loadConfig, AsyncCallback<PagingLoadResult<ClientBmd>> callback) {
    				myService.getClientBmds(applicationModel.getBankers(),(PagingLoadConfig)loadConfig,callback);
    			}
    		};
    		loader = new BasePagingLoader<PagingLoadResult<ClientBmd>>(proxy); 
    
    		loader.setRemoteSort(false);
    		loader.setSortField("clientName");
    		pagingBar = new PagingToolBar(pageSize);
    		pagingBar.bind(loader);  
    
    		clientsStore = new ListStore<ClientBmd>(loader);
    
    		setToolTip(toolTipText);
    		setHideTrigger(true); 
    		setForceSelection(true);
    		setTriggerAction(TriggerAction.ALL);
    		setDisplayField("clientName");
    		setStore(clientsStore);
    		setTypeAhead(true);
    		setPageSize(pageSize);
    		setMinChars(1);
    		setFieldLabel("Clienti");
    		
    	}
    }

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Try to disable the query cache.

  3. #3
    Sencha User francescoNemesi's Avatar
    Join Date
    Apr 2007
    Location
    London (UK), Milan (ITA)
    Posts
    148
    Vote Rating
    0
    francescoNemesi is on a distinguished road

      0  

    Default


    setUseQueryCache(false);

    Hos did I miss it? Thanks as ever, Sven

  4. #4
    Sencha User
    Join Date
    Nov 2012
    Posts
    1
    Vote Rating
    0
    fhanshar is on a distinguished road

      0  

    Default GXT 3.0

    GXT 3.0


    setUseQueryCache(.) is not visible in ComboBox GXT 3.0. I am having the same problem as the original poster, where the query for the Combo is being cached. I have not found a way to disable this caching property in GXT 3.0. Are there any workarounds?

    Thanks.

Similar Threads

  1. Force Combobox value if...
    By fruitwerks in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 13 Sep 2009, 12:57 PM
  2. Force ComboBox to always query
    By taocore in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 9 Sep 2009, 11:29 PM
  3. combobox force reload
    By italoc in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 11 Apr 2008, 12:51 AM
  4. Force ComboBox to always query remote server
    By consigliere in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 13 Jan 2008, 8:00 PM

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi