2.7.1. Contract Editor Screen Layout

Open the contract-edit.xml screen in Studio and completely replace its content with the following code:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/screen/window.xsd"
        caption="msg://editorCaption"
        focusComponent="form"
        messagesPack="com.company.bpmdemo.web.screens.contract">
    <data>
        <instance id="contractDc"
                  class="com.company.bpmdemo.entity.Contract"
                  view="_local">
            <loader id="contractDl"/>
        </instance>
        <collection id="procAttachmentsDc"
                    class="com.haulmont.bpm.entity.ProcAttachment"
                    view="procAttachment-browse">
            <loader id="procAttachmentsDl">
                <query><![CDATA[select e from bpm$ProcAttachment e
                                where e.procInstance.entity.entityId  = :entityId
                                order by e.createTs]]>
                </query>
            </loader>
        </collection>
    </data>
    <dialogMode height="600"
                width="800"/>
    <layout expand="editActions"
            spacing="true">
        <form id="form"
              dataContainer="contractDc">
            <column width="250px">
                <textField id="numberField"
                           property="number"/>
                <dateField id="dateField"
                           property="date"/>
                <textField id="stateField"
                           property="state"/>
            </column>
        </form>
        <groupBox id="procActionsBox"
                  caption="msg://process"
                  spacing="true"
                  width="AUTO"
                  orientation="vertical">
            <fragment id="procActionsFragment"
                      screen="bpm_ProcActionsFragment"/>
        </groupBox>
        <groupBox caption="msg://attachments"
                  height="300px"
                  spacing="true"
                  width="700px">
            <table id="attachmentsTable"
                   dataContainer="procAttachmentsDc"
                   height="100%"
                   width="100%">
                <columns>
                    <column id="file.name"/>
                    <column id="author"/>
                    <column id="type"/>
                    <column id="comment"
                            maxTextLength="50"/>
                </columns>
            </table>
        </groupBox>
        <hbox id="editActions"
              spacing="true">
            <button action="windowCommitAndClose"/>
            <button action="windowCommit"/>
            <button action="windowClose"/>
        </hbox>
    </layout>
</window>

The screen contains some fields for contract editing, a fragment for displaying process actions and a table with process attachments.