Hi Isomorphic,
please see this testcase which shows an annoying bug with RPCManager.cancelQueue(). It seems that canceling does not close the queue. New requests after cancelQueue() are still queued up and not sent directly.
Click the button "Recreate with cancel" and see that the ListGrid does not load. Using RPCManager.sendQueue() (with an empty queue) instead does solve the problem.
Tested using FF26, GC50 and v10.1p_2016-04-27.
BuiltInDS.java:
Best regards
Blama
please see this testcase which shows an annoying bug with RPCManager.cancelQueue(). It seems that canceling does not close the queue. New requests after cancelQueue() are still queued up and not sent directly.
Click the button "Recreate with cancel" and see that the ListGrid does not load. Using RPCManager.sendQueue() (with an empty queue) instead does solve the problem.
Tested using FF26, GC50 and v10.1p_2016-04-27.
BuiltInDS.java:
Code:
package com.smartgwt.sample.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.Version; import com.smartgwt.client.core.KeyIdentifier; import com.smartgwt.client.data.AdvancedCriteria; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.rpc.RPCManager; import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.PageKeyHandler; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.VLayout; public class BuiltInDS implements EntryPoint { public void onModuleLoad() { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("D"); Page.registerKey(debugKey, new PageKeyHandler() { public void execute(String keyName) { SC.showConsole(); } }); VLayout mainLayout = new VLayout(20); mainLayout.setWidth100(); mainLayout.setHeight100(); IButton recreateCancelBtn = new IButton("Recreate with cancel"); recreateCancelBtn.setWidth(200); recreateCancelBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { recreate("cancel"); } }); mainLayout.addMember(recreateCancelBtn); IButton recreateSendBtn = new IButton("Recreate with send"); recreateSendBtn.setWidth(200); recreateSendBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { recreate("send"); } }); mainLayout.addMember(recreateSendBtn); mainLayout.draw(); } private void recreate(String mode) { Window w = new Window(); w.setWidth("95%"); w.setHeight("95%"); w.setMembersMargin(0); w.setModalMaskOpacity(70); w.setTitle("cancelQueue() problem with " + Version.getSCVersionNumber()); w.setShowMinimizeButton(false); w.setIsModal(true); w.setShowModalMask(true); w.centerInPage(); SC.logWarn("Queue open: " + RPCManager.hasCurrentTransactionQueued()); RPCManager.startQueue(); SC.logWarn("Queue open: " + RPCManager.hasCurrentTransactionQueued()); if ("cancel".equals(mode)) RPCManager.cancelQueue(); else if ("send".equals(mode)) RPCManager.sendQueue(); SC.logWarn("Queue open: " + RPCManager.hasCurrentTransactionQueued()); ListGrid lg = new ListGrid(); lg.setWidth100(); lg.setAutoFetchData(false); lg.setDataSource(DataSource.get("supplyItem")); ListGridField itemName = new ListGridField("itemName"); ListGridField sku = new ListGridField("SKU"); ListGridField category = new ListGridField("category"); ListGridField unitCost = new ListGridField("unitCost"); lg.setFields(itemName, sku, category, unitCost); w.addItem(lg); w.show(); lg.fetchData(new AdvancedCriteria(sku.getName(), OperatorId.STARTS_WITH, "1")); } }
Blama
Comment