Can’t get Tree component working as expected

I have a table Tasks. It has a field of parent task, as association of the same entity.
I created a hierarchically data source over this entity with this field.
Pointed Tree component to this data source and data is shown, but, only one level, and almost all levels as root.

In database, there are about 10 records as root level ,with parentTask field as null. Then, others 900 records that are children From root items, or from their childrens, with about 5 levels of depth.

I expected to see it this way, but instead I get almost all records in root level with only one level of childrens. I checked documentation and samples but I don’t see what’s wrong.

I hope I explained correctly.

Hi,

Could you please provide either a demo project or at least a screen XML. It seems that the pagination mechanism limits the amount of data so that you don’t see the full hierarchy.

Regards,
Gleb

This is the XML of the screen:

<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
        caption="msg://caption"
        class="com.komenco.komerziaerp.web.sandbox.Pruebastree"
        messagesPack="com.komenco.komerziaerp.web.sandbox">
    <dsContext>
        <hierarchicalDatasource id="cuentaContablesDs"
                                class="com.komenco.komerziaerp.entity.contabilidad.CuentaContable"
                                hierarchyProperty="nivelSuperior"
                                view="cuentaContable-view">
            <query>
                <![CDATA[select e from komerziaerp$CuentaContable e]]>
            </query>
        </hierarchicalDatasource>
    </dsContext>
    <dialogMode height="600"
                width="800"/>
    <layout>
        <tree height="200px"
              width="606px">
            <treechildren captionProperty="cuenta"
                          datasource="cuentaContablesDs"/>
        </tree>
    </layout>
</window>

This is the Entity definition

imagen

Here a sample of data
imagen

And how it renders:
imagen

This is wrong
imagen

I should have only 9 Root levels, and the others records are all childrens of root or other childrens.
imagen

Unfortunately, I can’t reproduce the problem. Could you please attach a demo project?

Regards,
Gleb

After almost 1hour of create a new project, take the data from the remote computer, trying without success to make it working with HSQLDB, create a new Postgres database, import the SQL and so on…in this new project seems to work [ironic]great[/ironic]. Who knows what the hell is happening.

Unfortunately, it’s hard to guess. Just in case, try to use TreeTable, and check if everything displays as expected.