Hi Isomorphic,
please see this v10.1p_2016-07-08-based testcase, where the two SelectItems send too many requests on draw:
With ProgressiveLoading, it looks like this:
Without ProgressiveLoading it looks like this:
In both cases I'd expect not to see the red-marked requests. Please note the times sent of the requests. It seems that they are triggered after the previous requests was progressed on the client.
Also the 1st request is for rows 0-78. I find this suspicious as well, as this used to be 75 and the requests afterwards are for 75 rows.
BuiltInDS.java:
Best regards
Blama
please see this v10.1p_2016-07-08-based testcase, where the two SelectItems send too many requests on draw:
With ProgressiveLoading, it looks like this:
Without ProgressiveLoading it looks like this:
In both cases I'd expect not to see the red-marked requests. Please note the times sent of the requests. It seems that they are triggered after the previous requests was progressed on the client.
Also the 1st request is for rows 0-78. I find this suspicious as well, as this used to be 75 and the requests afterwards are for 75 rows.
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.DataSource; 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.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.SelectItem; 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 { private VLayout mainLayout; private IButton recreateBtn; private IButton recreateBtn2; 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(); } }); mainLayout = new VLayout(20); mainLayout.setWidth100(); mainLayout.setHeight100(); recreateBtn = new IButton("Recreate with ProgressiveLoading"); recreateBtn.setWidth(200); recreateBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { recreate(true); } }); recreateBtn2 = new IButton("Recreate without ProgressiveLoading"); recreateBtn2.setWidth(200); recreateBtn2.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { recreate(false); } }); mainLayout.addMembers(recreateBtn, recreateBtn2); mainLayout.draw(); } private void recreate(boolean withProgressiveLoading) { Window w = new Window(); w.setWidth("95%"); w.setHeight("95%"); w.setMembersMargin(0); w.setModalMaskOpacity(70); w.setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")"); w.setTitle("Too many requests in either case" + w.getTitle()); w.setShowMinimizeButton(false); w.setIsModal(true); w.setShowModalMask(true); w.centerInPage(); DynamicForm df = new DynamicForm(); SelectItem employeeSI = new EmployeeSI("EmployeeId", withProgressiveLoading); SelectItem supplyItemSI = new SupplyItemSI("itemID", withProgressiveLoading); df.setFields(employeeSI, supplyItemSI); w.addItem(df); w.show(); } private class ListGridFieldHidden extends ListGridField { public ListGridFieldHidden(String name) { super(name); setHidden(true); } } private class EmployeeSI extends SelectItem { public EmployeeSI(String name, boolean withProgressiveLoading) { super(name); setTitle("Employee"); setOptionDataSource(DataSource.get("employees")); setValueField("EmployeeId"); setDisplayField("Name"); setSortField("Gender"); setRequired(true); setValidateOnChange(true); ListGridField empname = new ListGridField("Name"); ListGridFieldHidden EmployeeId = new ListGridFieldHidden("EmployeeId"); ListGridFieldHidden EmployeeType = new ListGridFieldHidden("EmployeeType"); ListGridFieldHidden Gender = new ListGridFieldHidden("Gender"); setPickListFields(EmployeeId, empname, EmployeeType, Gender); if (withProgressiveLoading) { ListGrid plp = new ListGrid(); plp.setProgressiveLoading(true); setPickListProperties(plp); } } } private class SupplyItemSI extends SelectItem { public SupplyItemSI(String name, boolean withProgressiveLoading) { super(name); setTitle("SupplyItem"); setOptionDataSource(DataSource.get("supplyItem")); setValueField("itemID"); setDisplayField("itemName"); setSortField("category"); setRequired(true); setValidateOnChange(true); ListGridField itemName = new ListGridField("itemName"); ListGridFieldHidden itemID = new ListGridFieldHidden("itemID"); ListGridFieldHidden sku = new ListGridFieldHidden("SKU"); ListGridFieldHidden category = new ListGridFieldHidden("category"); setPickListFields(itemID, itemName, sku, category); if (withProgressiveLoading) { ListGrid plp = new ListGrid(); plp.setProgressiveLoading(true); setPickListProperties(plp); } } } }
Blama
Comment