我有:
- 人员浏览器屏幕,是标准的一个
- 人物编辑框架
- 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"/>
答案 0 :(得分:1)
选择要打开的屏幕时,standard actions使用以下约定:
{entity_name}.edit
用于打开编辑器界面{entity_name}.lookup
和{entity_name}.browse
用于打开查找屏幕在您的情况下,默认情况下浏览器会打开yournamespace$Person.edit
屏幕。您可以使用setWindowId()
方法指定要为任何操作打开的屏幕。
查看您的screens.xml
文件,了解哪些屏幕注册了哪些标识符。 Studio中的屏幕列表中提供了相同的信息。