Hi Isomorphic,
I have a new problem that only occurs in 12.0. version (12.0p/v12.0p_2018-08-23), not in 6.1.
I think this may be related to https://forums.smartclient.com/forum...-11-1-and-12-0. You can see there my createRecordComponents code.
Records are sorted by field "T_CHAT__LAST_ENTRY", when that value changes, the records should be sorted again.
I made a test case that does not show my problem directly, but I think it is related to my problem so let's start with it.
When I change the value of any record, that's always affect the first record and change it.
Best regards
Pavo
I have a new problem that only occurs in 12.0. version (12.0p/v12.0p_2018-08-23), not in 6.1.
I think this may be related to https://forums.smartclient.com/forum...-11-1-and-12-0. You can see there my createRecordComponents code.
Records are sorted by field "T_CHAT__LAST_ENTRY", when that value changes, the records should be sorted again.
I made a test case that does not show my problem directly, but I think it is related to my problem so let's start with it.
When I change the value of any record, that's always affect the first record and change it.
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.SortSpecifier; import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.types.SelectionStyle; import com.smartgwt.client.types.SortDirection; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.PageKeyHandler; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.Label; 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.grid.ListGridRecord; import com.smartgwt.client.widgets.layout.VLayout; public class BuiltInDS extends VLayout implements EntryPoint { private IButton recreateBtn; private final String fakeLGFName = "fakeLGFName"; 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(); } }); setWidth100(); setHeight100(); recreateBtn = new IButton("Recreate"); recreateBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { new MyWindow().show(); } }); addMember(recreateBtn); new MyWindow().show(); draw(); } private class MyWindow extends Window { public MyWindow() { setWidth(400); setHeight(600); setMembersMargin(0); setModalMaskOpacity(70); setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")"); SC.logWarn(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")"); setShowMinimizeButton(false); setIsModal(true); setShowModalMask(true); centerInPage(); VLayout vL = new VLayout(); // Img svgImg = new Img("http://127.0.0.1:8888/builtinds/tools/images/kiwi.svg", 100, 100); ListGrid lg = new ListGrid() { { setSelectionType(SelectionStyle.SINGLE); setVirtualScrolling(true); setShowRecordComponents(true); setShowRecordComponentsByCell(true); // Records becomes unreadable every next click in 12.0. version, we don't expect many record so this is fine solution. // setRecordComponentPoolingMode(RecordComponentPoolingMode.RECYCLE); setPoolComponentsPerColumn(true); setFixedRecordHeights(true); setRecordComponentHeight(56); setCanSort(false); setCanPickFields(false); setCanResizeFields(false); setCanAutoFitFields(false); setCanGroupBy(false); setAutoFetchData(false); setDataSource("animals"); ListGridField scientificNameLGF = new ListGridField(fakeLGFName); ListGridField lifeSpanLGF = new ListGridField("lifeSpan"); lifeSpanLGF.setCanEdit(true); setFields(scientificNameLGF, lifeSpanLGF); setSort(new SortSpecifier[] { new SortSpecifier("lifeSpan", SortDirection.DESCENDING) }); fetchData(new AdvancedCriteria(new Criterion("status", OperatorId.EQUALS, "Endangered"))); } @Override protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) { String fieldName = this.getFieldName(colNum); if (fakeLGFName.equals(fieldName)) { String topicName = record.getAttributeAsString("scientificName"); Label testLabel = new Label(); testLabel.setContents(topicName); VLayout vLayout = new VLayout(6); vLayout.setHeight(50); vLayout.setWidth100(); vLayout.setMembers(testLabel); this.setSort(new SortSpecifier[] { new SortSpecifier("lifeSpan", SortDirection.DESCENDING) }); return vLayout; } else return null; } }; vL.addMembers(lg); addItem(vL); } } }
Best regards
Pavo
Comment