Здравствуйте, столкнулся с проблемой.
При генерации колонки с изображением у таблицы пропадает scrollBar
Код, добавляющий генерируемую колонку:
imagesTable.addGeneratedColumn("DESCRIPTOR", image -> {
if (image.getDescriptor() != null) {
com.haulmont.cuba.gui.components.Image avatarImage = uiComponents.create(com.haulmont.cuba.gui.components.Image.class);
avatarImage.setValueSource(new ContainerValueSource<>(imagesTable.getInstanceContainer(image), "descriptor"));
return avatarImage;
}
return null;
});
XML:
<window xmlns="http://schemas.haulmont.com/cuba/screen/window.xsd"
xmlns:c="http://schemas.haulmont.com/cuba/screen/jpql_condition.xsd"
caption="msg://pointImageBrowse.caption"
focusComponent="imagesTable"
messagesPack="com.company.guaranocam.web.screens">
<data readOnly="true">
<collection id="imagesDc"
class="com.company.guaranocam.entity.Image">
<view extends="_local">
<property name="descriptor" view="_minimal"/>
</view>
<loader id="imagesDl">
<query>
<![CDATA[select e from guaranocam_Image e]]>
</query>
</loader>
</collection>
</data>
<dialogMode height="600"
width="800"/>
<layout expand="imagesTable"
spacing="true">
<label id = "numLabel" align="TOP_LEFT" ></label>
<label id = "addrLabel" align="TOP_LEFT" ></label>
<filter id="filter"
applyTo="imagesTable"
dataLoader="imagesDl">
<property name="date" caption="Date"/>
<property name="time" caption="Time"/>
</filter>
<groupTable id="imagesTable"
width="100%"
dataContainer="imagesDc" height="AUTO">
<actions>
<action id="remove" type="remove"/>
</actions>
<columns>
<column id="date" width="100"/>
<column id="time" width="50"/>
</columns>
<rowsCount/>
<buttonsPanel id="buttonsPanel"
alwaysVisible="true">
<button id="removeBtn" action="imagesTable.remove"/>
<button id="downloadBtn" caption="Download" invoke="onDownloadBtnClick"></button>
<button id="sliderBtn" caption="Show Slider" invoke="onSliderBtnClick"></button>
</buttonsPanel>
</groupTable>
<hbox id="lookupActions" spacing="true" visible="false">
<button action="lookupSelectAction"/>
<button action="lookupCancelAction"/>
</hbox>
</layout>
</window>
Пробовал сделать колонку в XML и добавить изображение через generator, результат тот же.
Пробовал удалять expand, но тогда получается скролл всей страницы, а мне нужен именно скролл таблицы.
При обновлении страницы или при переходе на другую и возврате скролл бар иногда появляется.
Стоит добавить, что изображения довольно большие по сравнению с текстом в других колонках.