Hi Isomorphic,
trying to create another testcase with hover removal (not done yet), I found this issue with browser scrollbars.
Please see this BuiltInDS-based testcase, where there are browser scrollbars for the main page on hover, if you hover the "Lifespan 999" in the "Piranha"-row.
It is not happening for other rows, as there is not enough data to display in the hover. After the hover is removed, the browser scrollbars stay (this is not about the hover-SmartGWT-Scrollbars, these are expected).
I do think that the browser scrollbars should not be there in the first place, but if that's not true, they should definitely be removed once the hover disappears.
I think this only happens if the ListGrid is in a window, but I might be wrong here.
Tested with v12.0p_2020-03-11 in current Chromium 84 and Firefox 78 under Win10 in SuperDevMode.
Best regards
Blama
BuiltInDS.java:
trying to create another testcase with hover removal (not done yet), I found this issue with browser scrollbars.
Please see this BuiltInDS-based testcase, where there are browser scrollbars for the main page on hover, if you hover the "Lifespan 999" in the "Piranha"-row.
It is not happening for other rows, as there is not enough data to display in the hover. After the hover is removed, the browser scrollbars stay (this is not about the hover-SmartGWT-Scrollbars, these are expected).
I do think that the browser scrollbars should not be there in the first place, but if that's not true, they should definitely be removed once the hover disappears.
I think this only happens if the ListGrid is in a window, but I might be wrong here.
Tested with v12.0p_2020-03-11 in current Chromium 84 and Firefox 78 under Win10 in SuperDevMode.
Best regards
Blama
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.Criterion; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.Record; import com.smartgwt.client.data.SortSpecifier; import com.smartgwt.client.types.Autofit; import com.smartgwt.client.types.GroupStartOpen; import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.types.RecordComponentPoolingMode; import com.smartgwt.client.types.SortArrow; 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.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 { 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("95%"); w.setHeight("95%"); w.setMembersMargin(0); w.setModalMaskOpacity(70); w.setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")"); w.setTitle("Scrollbars generated for tall DataBound hovers, also do no disappear afterwards" + w.getTitle()); w.setShowMinimizeButton(false); w.setIsModal(true); w.setShowModalMask(true); w.centerInPage(); LGWithhover myListGrid = new LGWithhover(); VLayout vLayout = new VLayout() { { addMembers(myListGrid); } }; w.addItem(vLayout); w.show(); } private class LGWithhover extends ListGrid { public LGWithhover() { super(DataSource.get("animals")); setShowRecordComponents(true); setShowRecordComponentsByCell(true); setRecordComponentPoolingMode(RecordComponentPoolingMode.RECYCLE); setPoolComponentsPerColumn(true); setRecordComponentHeight(22); setCanGroupBy(false); setCanReorderFields(true); setGroupStartOpen(GroupStartOpen.ALL); setSortByGroupFirst(true); setAllowFilterExpressions(true); setHoverWidth(1000); // In 12.0. click handler on group icon not working, this command fix problem, the color changes from now on the server side. setUseImageForSVG(true); setCanEdit(true); setShowFilterEditor(true); setAutoFetchData(true); setSortField("lifeSpan"); setShowHoverComponents(true); setCanHover(true); setGroupByField("status"); ListGridField commonName = new ListGridField("commonName"); ListGridField status = new ListGridField("status"); ListGridField lifeSpan = new ListGridField("lifeSpan"); setFields(commonName, status, lifeSpan); } @Override protected Canvas getCellHoverComponent(Record record, Integer rowNum, Integer colNum) { DSRequest requestPropeties = new DSRequest(); requestPropeties.setShowPrompt(false); if (Math.random() > 0.5) { setHoverWidth(400); } else { setHoverWidth(1000); } Integer lifeSpan = record.getAttributeAsInt("lifeSpan"); SC.logWarn("lifeSpan: " + (lifeSpan != null ? lifeSpan : "null")); SC.logWarn("fieldName: " + colNum + " / " + (getFieldName(colNum) != null ? getFieldName(colNum) : "null")); if ("lifeSpan".equals(getFieldName(colNum))) { ListGrid lg = new ListGrid(DataSource.get("employees")); lg.setWidth(300); lg.setAutoFitData(Autofit.VERTICAL); lg.setSort(new SortSpecifier("EmployeeId", SortDirection.DESCENDING)); lg.setShowSortArrow(SortArrow.NONE); ListGridField employeeId = new ListGridField("EmployeeId"); ListGridField name = new ListGridField("Name"); lg.setFields(employeeId, name); // lg.setFetchOperation("delayedFetch"); lg.fetchData(new Criterion("EmployeeId", OperatorId.LESS_OR_EQUAL, lifeSpan), null, requestPropeties); return lg; } else { return super.getCellHoverComponent(record, rowNum, colNum); } } } }
Comment