Fragment performance slow?

Hi,

We use have a screen that we wish to convert into a fragment.

However the new screen with the contained fragment (Looks exactly the same but contained within a fragment) is much slower - is there a reason for it to load slowly?

Here is my normal screen (this uses the old screen UI):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
        caption="msg://editorCaption"
        class="com.solutiondomain.fieldsolution.web.job.JobEditOLD"
        datasource="jobDs"
        focusComponent="fieldGroup"
        messagesPack="com.solutiondomain.fieldsolution.web.job">
    <dsContext>
        <datasource id="jobDs"
                    class="com.solutiondomain.fieldsolution.entity.Job"
                    view="job-edit-view">
            <collectionDatasource id="attachedFilesDs"
                                  property="attachedFiles"/>
        </datasource>
        <collectionDatasource id="tasksDs"
                              class="com.solutiondomain.fieldsolution.entity.Task"
                              maxResults="20"
                              view="task-with-job">
            <query>
                <![CDATA[select e from fieldsolution$Task e where e.job = :ds$jobDs and e.tasktype <> 1000 and e.tasktype < 50000]]></query>
        </collectionDatasource>
        <collectionDatasource id="logDs"
                              class="com.haulmont.cuba.security.entity.EntityLogItem"
                              view="logView">
            <query>
                <![CDATA[select i from sec$EntityLog i
                where i.entityRef.entityId = :ds$jobDs.id order by i.eventTs]]>
            </query>
            <collectionDatasource id="logAttrDs"
                                  property="attributes"/>
        </collectionDatasource>
        <collectionDatasource id="contractDs"
                    class="com.solutiondomain.fieldsolution.entity.Contract"
                    view="contract-view">
        </collectionDatasource>
        <collectionDatasource id="engineerDs"
                              class="com.solutiondomain.fieldsolution.entity.Engineer"
                              view="engineer-view">
        </collectionDatasource>
        <collectionDatasource id="operationManagerDs"
                              class="com.solutiondomain.fieldsolution.entity.Manager"
                              view="manager-view">
        </collectionDatasource>
    </dsContext>
    <dialogMode height="600"
                width="1000"/>
    <layout height="100%"
            spacing="true">
        <tabSheet height="100%">
            <tab id="jobinfo1"
                 caption="Main Data"
                 margin="true,false,false,false"
                 spacing="true">
                <scrollBox height="100%" width="100%">
                    <groupBox id="jobDetailsBox"
                              spacing="true">
                        <frame id="windowActions"
                               screen="customJobEditWindowActions"/>
                        <hbox spacing="true" width="100%">
                            <vbox spacing="true">
                                <fieldGroup id="fieldGroup"
                                            datasource="jobDs" width="50%">
                                    <field caption="Job Reference"
                                           property="reference" >
                                        <validator class="com.solutiondomain.fieldsolution.web.job.JobEditOLD$ReferenceValidator"/>
                                    </field>
                                    <field id="referenceOverride"
                                           caption="Override Reference"
                                           custom="true"
                                           editable="true"/>
                                    <field property="contract"
                                    optionsDatasource="contractDs" />
                                    <field editable="false"
                                           property="contract.client"/>
                                    <field id="clientReference"
                                           custom="true"
                                           editable="false"/>
                                    <field editable="false"
                                           property="contract.phase"/>
                                    <field cols="20"
                                           editable="false"
                                           property="contract.siteAddress"
                                           rows="5"/>
                                    <field editable="false"
                                           property="contract.postcode"/>
                                    <field property="worktype"/>
                                    <field custom="true"
                                           property="jobStatus"/>
                                    <field property="appointmentStartDate"/>
                                </fieldGroup>
                                <fieldGroup id="fieldGroup2"
                                            datasource="jobDs" width="50%">
                                    <field property="appointmentEndDate"/>
                                    <field property="timeslot"/>
                                    <field property="contactSupervisor" caption="TriConnex Contact (Supervisor)"/>
                                    <field property="contactTeam" caption="TriConnex Contact (Team)"/>
                                    <field property="siteName"/>
                                    <field property="phaseNumber"/>
                                    <field property="wiapsNumber"/>
                                    <field property="meterModel"/>
                                </fieldGroup>

                            </vbox>
                            <vbox spacing="true">
                                <fieldGroup id="fieldGroup3"
                                            datasource="jobDs" width="50%">
                                    <field property="engineer" optionsDatasource="engineerDs"/>
                                    <field id="supervisor"
                                           custom="true"
                                           editable="false"/>
                                    <field id="supervisorNumber"
                                           custom="true"
                                           editable="false"/>
                                    <field property="operationsManager"
                                        optionsDatasource="operationManagerDs"/>
                                    <field property="contactName"/>
                                    <field property="contactNumber"/>
                                    <field property="subName"/>
                                    <field property="houseNumber"/>
                                    <field property="buildingName"/>
                                    <field property="street"/>
                                    <field property="district"/>
                                    <field property="city"/>
                                    <field property="dependantStreet"/>
                                    <field property="postCode"/>
                                    <field property="notes"/>
                                    <field property="materialsOrdered"/>
                                    <field property="materialOrderNumber"/>
                                    <field property="materialOrderedDate"/>
                                    <field property="materialDueDate"/>
                                    <field property="siteReady"/>
                                    <field property="sitePhoned"/>
                                    <field property="vo"/>
                                </fieldGroup>
                                <fieldGroup id="fieldGroup4"
                                            datasource="jobDs" width="50%">
                                    <column width="300px">
                                        <field property="ro"/>
                                        <field editable="false"
                                               property="contract.shipper"/>
                                        <field editable="false"
                                               property="contract.meterType"/>
                                        <field property="rtmlRequired"/>
                                        <field property="workInstructionNumber"/>
                                        <field property="issuingEngineer"/>
                                        <field property="issuingEngineerContact"/>
                                        <field property="supplierCode"/>
                                        <field property="supplierName"/>
                                        <field property="notificationNumber"/>
                                        <field property="mprn"/>
                                        <field property="meterJobType"/>
                                        <field property="meterSerialNumber"/>

                                        <field property="newMeterModel"/>
                                        <field property="pressure"/>
                                    </column>
                                </fieldGroup>
                            </vbox>

                        </hbox>
                        <vbox spacing="true">
                            <resizableTextArea id="jobDescription" datasource="jobDs" property="jobDescription"
                                      caption="Job Description" resizable="true"/>
                            <resizableTextArea id="specialNotes" datasource="jobDs" property="specialNotes"
                                      caption="Special Notes" resizable="true"/>
                        </vbox>
                        <frame id="windowactions_1"
                               screen="extendedEditWindowActions"/>
                    </groupBox>
                </scrollBox>
            </tab>
            <tab id="jobedit2"
                 caption="Tasks"
                 margin="true,false,false,false"
                 spacing="true">
                <scrollBox height="100%"
                           spacing="true">
                    <frame id="windowActions2"
                           screen="extendedEditWindowActions"/>
                    <groupBox id="tasksBox"
                              caption="Tasks"
                              spacing="true">
                        <table id="tasksTable"
                               width="100%">
                            <actions>
                                <action id="create"
                                        openType="DIALOG"/>
                                <action id="edit"/>
                                <action id="remove"/>
                            </actions>
                            <columns>
                                <column id="taskNumber"
                                        caption="Number"/>
                                <column id="tasktype"
                                        caption="Type"/>
                                <column id="taskDetails.plot"/>
                                <column id="status"/>
                                <column id="createTs"/>
                                <column id="taskNotes"/>
                                <column id="taskStartDate"/>
                                <column id="taskEndDate"/>
                            </columns>
                            <rows datasource="tasksDs"/>
                            <rowsCount/>
                            <buttonsPanel id="buttonsPanel"
                                          alwaysVisible="true">
                                <button id="taskCreateButton"
                                        action="tasksTable.create"
                                        caption="New Task"/>
                                <button action="tasksTable.remove"
                                        caption="Delete Task"/>
                            </buttonsPanel>
                        </table>
                    </groupBox>
                    <button id="serviceJobButton" caption="Services job card" stylename="friendly" width="100%"
                            invoke="showServicesCompletedInformation" visible="false"/>
                    <button id="materialsRecordingButton" caption="View materials left on site" stylename="friendly" width="100%"
                            invoke="showMaterialsRecordingCompletedInformation" visible="false"/>
                </scrollBox>
            </tab>
            <tab id="jobedit3"
                 caption="Attachments"
                 margin="true,false,false,false"
                 spacing="true">
                <scrollBox height="100%"
                           spacing="true">
                    <frame id="windowActions3"
                           screen="extendedEditWindowActions"/>
                    <vbox id="dropZone"
                          spacing="true">
                        <groupBox id="attachedFilesBox"
                                  caption="msg://com.solutiondomain.fieldsolution.entity/Job.attachedFiles">
                            <table id="attachedFilesTable"
                                   height="200px"
                                   width="100%">
                                <actions>
                                    <action id="remove"/>
                                    <action id="download"
                                            caption="Download"
                                            invoke="onDownload" />
                                </actions>
                                <columns>
                                    <column id="name"/>
                                    <column id="extension"/>
                                    <column id="size"/>
                                    <column id="createDate"/>
                                </columns>
                                <rows datasource="attachedFilesDs"/>
                                <buttonsPanel>
                                    <button id="attachRemove" action="attachedFilesTable.remove"/>
                                    <button action="attachedFilesTable.download"
                                            caption="Download"/>
                                    <upload id="upload"
                                            dropZone="dropZone"
                                            uploadButtonCaption="Select File to Upload"/>
                                </buttonsPanel>
                            </table>
                        </groupBox>
                    </vbox>
                </scrollBox>
            </tab>
            <tab id="jobauditttab"
                 caption="Audit Trail"
                 margin="true,false,false,false"
                 spacing="true">
                <scrollBox id="auditLogBox"
                           caption="Audit Log"
                           height="100%">
                    <vbox spacing="true">
                        <table id="logTable"
                               height="60%"
                               width="100%">
                            <columns>
                                <column id="eventTs"/>
                                <column id="user.login"/>
                                <column id="type"/>
                            </columns>
                            <rows datasource="logDs"/>
                            <rowsCount/>
                        </table>
                        <table id="logAttrTable"
                               height="40%"
                               width="100%">
                            <columns>
                                <column id="name"/>
                                <column id="value"/>
                            </columns>
                            <rows datasource="logAttrDs"/>
                            <rowsCount/>
                        </table>
                    </vbox>
                </scrollBox>
            </tab>
        </tabSheet>
    </layout>
</window>

Here is the fragment:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<fragment xmlns="http://schemas.haulmont.com/cuba/screen/fragment.xsd">
    <data>
        <instance id="jobDc"
                  class="com.solutiondomain.fieldsolution.entity.Job"
                  provided="true">
            <loader id="jobDl" provided="true"/>
            <collection id="attachedFilesDc" provided="true" property="attachedFiles"/>
            <collection id="completedFilesDc" provided="true" property="completedFiles"/>
        </instance>
        <collection id="operationsManagersDc" provided="true" class="com.solutiondomain.fieldsolution.entity.Manager" view="_local">
            <loader id="operationsManagersLc" provided="true"/>
        </collection>
        <collection id="tasksDc" provided="true" class="com.solutiondomain.fieldsolution.entity.Task" view="task-with-job">
            <loader id="tasksDl" provided="true"/>
        </collection>
        <collection id="logDc"
                    class="com.haulmont.cuba.security.entity.EntityLogItem"
                    view="logView"
                    provided="true">
            <loader id="logDl" provided="true"/>
            <collection id="logAttrDc"
                        property="attributes"
                        provided="true"/>
        </collection>
    </data>
    <layout spacing="true" expand="jobEditFragmentTabsheet">
        <tabSheet id="jobEditFragmentTabsheet">
            <tab id="jobinfo1"
                 caption="Job Data"
                 margin="true,false,false,false"
                 spacing="true">
                <form id="form" dataContainer="jobDc">
                    <column width="250px">
                        <textField id="referenceField" editable="false" property="reference" caption="Job Reference"/>
                        <checkBox id="referenceOverride"
                                  caption="Override Reference"
                                  editable="true"/>
                        <pickerField id="contractField" property="contract">
                            <actions>
                                <action id="lookup" type="picker_lookup"/>
                                <action id="clear" type="picker_clear"/>
                            </actions>
                        </pickerField>
                        <textField id="contractClientField" property="contract.client" editable="false"/>
                        <textField id="clientReference" editable="false" caption="Client Reference"/>
                        <textField id="contractPhaseField" property="contract.phase" editable="false"/>
                        <textArea id="contractSiteAddressTextArea"
                                  cols="20"
                                  editable="false"
                                  property="contract.siteAddress"
                                  rows="5"/>
                        <textField id="contractPostcodeField" property="contract.postcode" editable="false"/>
                        <lookupField id="worktypeField" property="worktype"/>
                        <lookupField id="statusField" property="status"/>
                        <dateField id="appointmentStartDateField" property="appointmentStartDate"/>
                        <dateField id="appointmentEndDateField" property="appointmentEndDate"/>
                        <lookupField id="timeslotField" property="timeslot"/>
                        <textField id="contactSupervisorField" property="contactSupervisor" caption="TriConnex Contact (Supervisor)"/>
                        <textField id="contactTeamField" property="contactTeam" caption="TriConnex Contact (Team)"/>
                        <textField id="siteNameField" property="siteName"/>
                        <textField id="phaseNumberField" property="phaseNumber"/>
                        <textField id="meterModelField" property="meterModel"/>
                    </column>
                    <column width="250px">
                        <pickerField id="engineerField" property="engineer">
                            <actions>
                                <action id="lookup" type="picker_lookup"/>
                                <action id="clear" type="picker_clear"/>
                            </actions>
                        </pickerField>
                        <lookupPickerField id="operationsManagerField" optionsContainer="operationsManagersDc"
                                           property="operationsManager" caption="Operations Manager">
                            <actions>
                                <action id="open" type="picker_open"/>
                            </actions>
                        </lookupPickerField>
                        <textField id="contactNumberField" property="contactNumber"/>
                        <textField id="notesField" property="notes"/>
                        <checkBox id="materialsOrderedField" property="materialsOrdered"/>
                        <textField id="materialOrderNumberField" property="materialOrderNumber"/>
                        <dateField id="materialOrderedDateField" property="materialOrderedDate"/>
                        <dateField id="materialDueDateField" property="materialDueDate"/>
                        <checkBox id="siteReadyField" property="siteReady"/>
                        <checkBox id="sitePhonedField" property="sitePhoned"/>
                        <checkBox id="voField" property="vo"/>
                        <checkBox id="roField" property="ro"/>
                        <textField id="contractShipperField" property="contract.shipper" editable="false"/>
                        <textField id="contractMeterType" property="contract.meterType" editable="false"/>
                        <textField id="rtmlRequiredField" property="rtmlRequired"/>
                        <textField id="workInstructionNumberField" property="workInstructionNumber"/>
                        <textField id="issuingEngineerField" property="issuingEngineer"/>
                        <textField id="issuingEngineerContactField" property="issuingEngineerContact"/>
                        <textField id="supplierCodeField" property="supplierCode"/>
                        <textField id="supplierNameField" property="supplierName"/>
                        <textField id="notificationNumberField" property="notificationNumber"/>
                        <textField id="mprnField" property="mprn"/>
                        <textField id="meterJobTypeField" property="meterJobType"/>
                        <textField id="meterSerialNumberField" property="meterSerialNumber"/>
                        <textField id="newMeterModelField" property="newMeterModel"/>
                        <textField id="pressureField" property="pressure"/>
                    </column>
                </form>
                <vbox spacing="true">
                    <textArea id="jobDescription" dataContainer="jobDc" property="jobDescription"
                              caption="Job Description" width="100%"/>
                    <textArea id="specialNotes" dataContainer="jobDc" property="specialNotes"
                              caption="Special Notes" width="100%"/>
                </vbox>
            </tab>
            <tab id="tasksTab"
                 caption="Tasks"
                 margin="true,false,false,false"
                 spacing="true"
                 enable="false">
                <groupBox id="tasksBox"
                          caption="Tasks"
                          spacing="true">
                    <table id="tasksTable"
                           dataContainer="tasksDc"
                           width="54.70pc">
                        <actions>
                            <action id="create" type="create"/>
                            <action id="edit" type="edit"/>
                            <action id="remove" type="remove"/>
                        </actions>
                        <columns>
                            <column id="taskNumber"
                                    caption="Number"/>
                            <column id="tasktype"
                                    caption="Type"/>
                            <column id="status"/>
                            <column id="createTs"/>
                            <column id="taskNotes"/>
                            <column id="taskStartDate"/>
                            <column id="taskEndDate"/>
                        </columns>
                        <buttonsPanel id="buttonsPanel"
                                      alwaysVisible="true">
                            <button id="taskCreateButton"
                                    action="tasksTable.create"
                                    caption="New Task"/>
                            <button id="taskEditButton" action="tasksTable.edit" caption="Edit Task"/>
                            <button id="taskRemoveButton" action="tasksTable.remove"
                                    caption="Delete Task"/>
                        </buttonsPanel>
                    </table>
                </groupBox>
                <button id="serviceJobButton" caption="Services job card" stylename="friendly" width="100%"
                        invoke="showServicesCompletedInformation" visible="false"/>
            </tab>
            <tab id="attachmentsTab"
                 caption="Attachments"
                 margin="true,false,false,false"
                 spacing="true">
                <groupBox id="dropZone" caption="msg://com.solutiondomain.fieldsolution.entity/Job.attachedFiles">
                    <table id="attachedFilesTable" dataContainer="attachedFilesDc" width="100%">
                        <actions>
                            <action id="remove" type="remove"/>
                            <action id="download"
                                    caption="Download"/>
                        </actions>
                        <columns>
                            <column id="name"/>
                            <column id="createDate"/>
                            <column id="extension"/>
                            <column id="size"/>
                        </columns>
                        <buttonsPanel>
                            <button id="attachRemove" action="attachedFilesTable.remove" caption="Remove"/>
                            <button action="attachedFilesTable.download"
                                    caption="Download"/>
                            <upload id="upload"
                                    uploadButtonCaption="Select File to Upload"
                                    fileStoragePutMode="MANUAL"/>
                        </buttonsPanel>
                    </table>
                </groupBox>
            </tab>
            <tab id="jobauditttab"
                 caption="Audit Log"
                 margin="true,false,false,false"
                 spacing="true">
                <groupBox id="auditLogBox"
                          caption="Audit Log"
                          height="100%">
                    <vbox spacing="true">
                        <table id="logTable"
                               height="60%"
                               width="100%"
                               dataContainer="logDc">
                            <columns>
                                <column id="eventTs"/>
                                <column id="user.login"/>
                                <column id="type"/>
                            </columns>
                        </table>
                        <table id="logAttrTable"
                               height="40%"
                               width="100%"
                               dataContainer="logAttrDc">
                            <columns>
                                <column id="name"/>
                                <column id="value"/>
                            </columns>
                        </table>
                    </vbox>
                </groupBox>
            </tab>
        </tabSheet>
    </layout>
</fragment>

The fragment is contained in an empty screen and is going to be used in other screens.

Why does the fragment take much longer to load than the same UI that is contained within a screen?

Thank you for any assistance

Regards

Matt

Hi Cuba,

I noticed Alex confirmed the performance is indeed slower in the above circumstance on my previous post.

Any idea when this might be fixed?

Thank you

Regards

Matt