PDA

View Full Version : PagingModelMemoryProxy and combobox



tothit
8 May 2009, 5:42 AM
I try this code, and it is works for me, but the combo only search in the actual page.


public class AllomasCombo_local extends ComboBox {

String lastQuery;

public AllomasCombo_local() {


PagingModelMemoryProxy proxy = new PagingModelMemoryProxy (AppData.getAllomasok());


PagingLoader loader = new BasePagingLoader(proxy);
loader.setRemoteSort(true);

ListStore<AllomasModel> store = new ListStore<AllomasModel>(loader);
loader.load(0,50);

// store.add(AppData.getAllomasok());
//loader.load();


this.setDisplayField("allomasNev");
this.setValueField("allomasId");
this.setPageSize(50);
this.setStore(store);
this.setMinChars(1);
this.setMinListWidth(350);
this.setAutoWidth(false);
this.setAllowBlank(false);
this.setTriggerAction(ComboBox.TriggerAction.ALL);
//this.setForceSelection(true);


}



}
Maybe I need to rewrite the combobox's doQuery method, but I can't becouse of the private variables.

Please, give me any advice!

Yodakoda
25 Mar 2011, 8:48 AM
Hi, I have just successfully implimented this.
You have to bind the loader to the paging toolbar of the combobox.

add:


combo.getPagingToolBar().bind(loader);


And your paging will work from the memory datastore.