EntityDiffViewer diffTable Remains Empty After Invoking compareSnapshots

Per section 5.9.5. Entity Snapshots in the Developer’s Manual, I have implemented logic to save and display entity snapshots on my entity editor page. Saving and loading the snapshots is working well, I can see the snapshots displayed in the EntityDiffViewer’s snapshotsTable component. However, I am unable to view the details of those snapshots. When I select 2 snapshots and click the Compare button, the diffTable remains blank. I see no errors in the Tomcat console, nor do I see any issues while debugging and stepping through the compareSnapshots() method. Any ideas as to what might cause this problem?

Hi Amanda,

Unfortunately, we cannot reproduce the problem. Could you please attach a sample project where the problem can be reproduced? Thank you.

Hi Olga,
Thanks for getting back to me so quickly! Attached you will find the source for the affected entity, the entity’s edit screen, and the edit screen’s controller. Hopefully that’s enough information for you to reproduce the issue, as I am unable to provide the entire project. The code to embed the EntityDiffViewer matches the example in the documentation exactly, so perhaps there’s something about my entity and/or edit page configuration that is causing the problem.

Inquiry.java (5.7K)

InquiryEdit.java (1.7K)

inquiry-edit.xml (5.1K)

I’ve reproduced your problem. The cause was truly cosmetic: the table was not displayed due to the layout overlapping. I’ve solved it by setting an absolute height for diffFrame inside scrollBox:

    <layout expand="scrollBox"
            spacing="true">
        <scrollBox id="scrollBox"
                   spacing="true">
              ...
            <groupBox id="historyBox"
                      caption="History">
                <frame id="diffFrame"
                       screen="indexdemo$Inquiry.edit"
                       width="100%"
                       height="400px"
                       src="/com/haulmont/cuba/gui/app/core/entitydiff/diff-view.xml"/>
            </groupBox>
        </scrollBox>
        <frame id="windowActions"
               screen="editWindowActions"/>
    </layout>

You can try to adjust the containers’ heights and the expand attribute as well. For more information on layout rules and troubleshooting see https://cuba-platform.com/tutorials/screen-layout-rules

Please let us know if that helped.

1 Like

Thank you so much, Olga! Setting an absolute height for diffFrame did the trick. I’ll explore the height and expand attributes, as well. I really appreciate your quick response.