Hi Isomorphic,
I have an issue in current 5.1p (v10.1p_2017-03-02), but it is so basic, I'm not sure my expectation is correct.
If I update a record or send updated data via serverside addRelatedUpdate(), this data is updated in the GUI in ListGrids displaying the selected record.
This does not happen for DynamicForm. Neither DataSource.updateCaches() nor DataBoundComponent docs say anything about why this should not happen for DynamicForms as well.
Is this a bug? See this BuiltInDS-based testcase.
Steps to reproduce:
Best regards
Blama
I have an issue in current 5.1p (v10.1p_2017-03-02), but it is so basic, I'm not sure my expectation is correct.
If I update a record or send updated data via serverside addRelatedUpdate(), this data is updated in the GUI in ListGrids displaying the selected record.
This does not happen for DynamicForm. Neither DataSource.updateCaches() nor DataBoundComponent docs say anything about why this should not happen for DynamicForms as well.
Is this a bug? See this BuiltInDS-based testcase.
Steps to reproduce:
- Edit the row in one of the ListGrids to see the data changed in the other ListGrid as well. DynamicForms are unchanged (unexpected).
- Edit the record in the DynamicForm and hit "save" to see the data changed in both ListGrids. The other DynamicForm is unchanged (unexpected).
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.Alignment; 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.ButtonItem; import com.smartgwt.client.widgets.form.fields.FormItem; 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 btn = new IButton("Recreate"); btn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { recreate(); } }); mainLayout.addMember(btn); } recreate(); mainLayout.draw(); } private void recreate() { Window w = new Window(); w.setWidth("95%"); w.setHeight("95%"); w.setMembersMargin(30); w.setModalMaskOpacity(70); w.setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")"); w.setTitle("DataBoundComponent update behavior" + w.getTitle()); w.setShowMinimizeButton(false); w.setIsModal(true); w.setShowModalMask(true); w.centerInPage(); w.addItem(new DynamicFormSupplyItem()); w.addItem(new DynamicFormSupplyItem()); w.addItem(new ListGridSupplyItem()); w.addItem(new ListGridSupplyItem()); w.show(); } private final class DynamicFormSupplyItem extends DynamicForm { public DynamicFormSupplyItem() { { setDataSource(DataSource.get("supplyItem")); setIsGroup(true); setGroupTitle("To see DynamicForm dimensions"); setWidth(400); final FormItem itemID = new FormItem("itemID"); final FormItem itemName = new FormItem("itemName"); final FormItem SKU = new FormItem("SKU"); final FormItem description = new FormItem("description"); final FormItem category = new FormItem("category"); final ButtonItem save = new ButtonItem("SAVE", "Save") { { setWidth(100); setColSpan(2); setAlign(Alignment.RIGHT); addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() { @Override public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) { getForm().saveData(); }; }); } }; setFields(itemID, itemName, SKU, description, category, save); fetchData(new AdvancedCriteria(new Criterion("SKU", OperatorId.EQUALS, "58074602"))); } } } private final class ListGridSupplyItem extends ListGrid { public ListGridSupplyItem() { { setDataSource(DataSource.get("supplyItem")); setAutoFetchData(false); setWidth(800); setHeight(100); setCanEdit(true); final ListGridField itemID = new ListGridField("itemID"); final ListGridField itemName = new ListGridField("itemName"); final ListGridField SKU = new ListGridField("SKU"); final ListGridField description = new ListGridField("description"); final ListGridField category = new ListGridField("category"); setFields(itemID, itemName, SKU, description, category); fetchData(new AdvancedCriteria(new Criterion("SKU", OperatorId.EQUALS, "58074602"))); } } } }
Blama
Comment