Hi Isomorphic,
please see this BuiltInDS based testcase (v12.0p_2018-12-13) where on start there are two fetches, while I'd only expect one:
BuiltInDS.java:
Best regards
Blama
please see this BuiltInDS based testcase (v12.0p_2018-12-13) where on start there are two fetches, while I'd only expect one:
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.Criterion; import com.smartgwt.client.data.DataSource; 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.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.layout.VLayout; public class BuiltInDS implements EntryPoint { private VLayout mainLayout; private IButton recreateBtn; 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"); recreateBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { recreate(); } }); mainLayout.addMember(recreateBtn); recreate(); mainLayout.draw(); } private void recreate() { Window w = new Window(); w.setWidth("25%"); w.setHeight("45%"); w.setMembersMargin(0); w.setModalMaskOpacity(70); w.setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")"); w.setTitle("DynamicForm SelectItem fetches pickList data even though the form itself is not editable" + w.getTitle()); w.setShowMinimizeButton(false); w.setIsModal(true); w.setShowModalMask(true); w.centerInPage(); final DynamicForm supplyItemForm = new DynamicForm(); supplyItemForm.setCanEdit(false); supplyItemForm.setDataSource(DataSource.get("supplyItem")); supplyItemForm.setHeight100(); supplyItemForm.setWidth100(); supplyItemForm.setAutoFetchData(false); FormItem itemID = new FormItem("itemID"); SelectItem itemName = new SelectItem("itemName"); FormItem sku = new FormItem("SKU"); sku.setEditorProperties(new FormItem()); FormItem category = new FormItem("category"); supplyItemForm.setFields(itemID, itemName, sku, category); supplyItemForm.fetchData(new AdvancedCriteria(new Criterion(sku.getName(), OperatorId.EQUALS, "58074604"))); w.addItem(supplyItemForm); w.show(); } }
Best regards
Blama
Comment