我有:
- 一个标准的 Person 浏览器屏幕
- 一个 Person 编辑器框架
- 一个仅包含 Person 编辑器框架的 Person 编辑器屏幕
出于某种原因,当我从浏览器打开编辑器时,我面对的屏幕不是我所期望的,而且我没有设计。所述屏幕似乎是动态自动生成的。
框架设计(映射到 person-edit-frame.xml):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
caption="msg://editCaption"
class="com.busy.busyapp.gui.person.PersonEditFrame"
messagesPack="com.busy.busyapp.gui.person">
<dsContext>
<datasource id="personDs"
class="com.busy.busyapp.entity.Person"
view="person-view">
<collectionDatasource id="phoneLinesDs"
property="phoneLines"/>
</datasource>
</dsContext>
<layout expand="rootBox"
spacing="true">
<scrollBox id="rootBox"
spacing="true">
<vbox id="details"
spacing="true">
<fieldGroup id="typeFieldGroup"
datasource="personDs">
<column width="250px">
<field id="type"
custom="true"/>
</column>
</fieldGroup>
<fieldGroup id="titleFieldGroup"
datasource="personDs">
<column width="250px">
<field id="title"
custom="true"/>
</column>
</fieldGroup>
<fieldGroup id="positionFieldGroup"
datasource="personDs">
<column width="250px">
<field id="position"
custom="true"/>
</column>
</fieldGroup>
<fieldGroup id="nameFieldGroup"
datasource="personDs">
<column width="250px">
<field id="name"/>
</column>
<column width="250px">
<field id="firstName"/>
</column>
</fieldGroup>
</vbox>
<groupBox id="phoneLinesBox"
caption="msg://com.busy.busyapp.entity/Person.phoneLines">
<table id="phoneLinesTable"
height="200px"
width="100%">
<actions>
<action id="add"
openType="DIALOG"/>
<action id="remove"/>
</actions>
<columns>
<column id="label"/>
<column id="number"/>
</columns>
<rows datasource="phoneLinesDs"/>
<buttonsPanel>
<button action="phoneLinesTable.add"
icon="font-icon:PLUS"/>
<button action="phoneLinesTable.remove"
icon="font-icon:MINUS"/>
</buttonsPanel>
</table>
</groupBox>
</scrollBox>
<frame id="windowActions"
screen="extendedEditWindowActions"/>
</layout>
嵌入框架的屏幕(映射到 person-edit.xml):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
caption="msg://editCaption"
class="com.busy.busyapp.gui.person.PersonEdit"
datasource="personDs"
messagesPack="com.busy.busyapp.gui.person">
<dsContext>
<datasource id="personDs"
class="com.busy.busyapp.entity.Person"
view="person-view">
<collectionDatasource id="phoneLinesDs"
property="phoneLines"/>
</datasource>
</dsContext>
<layout spacing="true">
<label id="toto"
datasource="personDs"
property="id"/>
<frame screen="busyapp$Person.edit.frame"/>
<scrollBox height="100px"
spacing="true"/>
<frame id="windowActions"
screen="extendedEditWindowActions"/>
</layout>
我得到的屏幕:
编辑:screens.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<screen-config xmlns="http://schemas.haulmont.com/cuba/screens.xsd">
<screen id="busyapp$Customer.browse"
template="com/busy/busyapp/gui/customer/customer-browse.xml"/>
<screen id="busyapp$Customer.edit"
template="com/busy/busyapp/gui/customer/customer-edit.xml"/>
<screen id="busyapp$ImpBusyArticles.browse"
template="com/busy/busyapp/gui/impbusyarticles/impbusyarticles-browse.xml"/>
<screen id="busyapp$ImpBusyArticles.edit"
template="com/busy/busyapp/gui/impbusyarticles/impbusyarticles-edit.xml"/>
<screen id="busyapp$Product.browse"
template="com/busy/busyapp/gui/product/product-browse.xml"/>
<screen id="busyapp$Product.edit"
template="com/busy/busyapp/gui/product/product-edit.xml"/>
<screen id="busyapp$ProductFamily.browse"
template="com/busy/busyapp/gui/productfamily/product-family-browse.xml"/>
<screen id="busyapp$ProductFamily.edit"
template="com/busy/busyapp/gui/productfamily/product-family-edit.xml"/>
<screen id="busyapp$Provider.browse"
template="com/busy/busyapp/gui/provider/provider-browse.xml"/>
<screen id="busyapp$Provider.edit"
template="com/busy/busyapp/gui/provider/provider-edit.xml"/>
<screen id="busyapp$Stock.browse"
template="com/busy/busyapp/gui/stock/stock-browse.xml"/>
<screen id="busyapp$Stock.edit"
template="com/busy/busyapp/gui/stock/stock-edit.xml"/>
<screen id="busyapp$VatRate.browse"
template="com/busy/busyapp/gui/vatrate/vat-rate-browse.xml"/>
<screen id="busyapp$VatRate.edit"
template="com/busy/busyapp/gui/vatrate/vat-rate-edit.xml"/>
<screen id="busyapp$SalePrice.browse"
template="com/busy/busyapp/gui/saleprice/sale-price-browse.xml"/>
<screen id="busyapp$SalePrice.edit"
template="com/busy/busyapp/gui/saleprice/sale-price-edit.xml"/>
<screen id="busyapp$SupplyPrice.browse"
template="com/busy/busyapp/gui/supplyprice/supply-price-browse.xml"/>
<screen id="busyapp$SupplyPrice.edit"
template="com/busy/busyapp/gui/supplyprice/supply-price-edit.xml"/>
<screen id="busyapp$Person.browse"
template="com/busy/busyapp/gui/person/person-browse.xml"/>
<screen id="busyapp$Person.edit"
template="com/busy/busyapp/gui/person/person-edit.xml"/>
<screen id="busyapp$Order.browse"
template="com/busy/busyapp/gui/order/order-browse.xml"/>
<screen id="busyapp$Order.edit"
template="com/busy/busyapp/gui/order/order-edit.xml"/>
<screen id="busyapp$Invoice.browse"
template="com/busy/busyapp/gui/invoice/invoice-browse.xml"/>
<screen id="busyapp$Invoice.edit"
template="com/busy/busyapp/gui/invoice/invoice-edit.xml"/>
<screen id="busyapp$Person.edit.frame"
template="com/busy/busyapp/gui/person/person-edit-frame.xml"/>