CUBA:编辑操作不会打开预期的屏幕
CUBA : edit action does not open expected screen
我有:
- 标准的个人浏览器屏幕
- 人物编辑器框架
- 一个人物编辑器屏幕,其中仅包含人物编辑器框架
出于某种原因,当我从浏览器打开编辑器时,我面对的是一个不是我期望的屏幕,我没有设计。上述屏幕似乎是即时自动生成的。
框架设计(映射到人员编辑-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>
嵌入框架的屏幕(映射到人-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"/>
standard actions 在选择要打开的屏幕时使用以下约定:
{entity_name}.edit
用于打开编辑器屏幕
{entity_name}.lookup
和 {entity_name}.browse
用于打开查找屏幕
对于您的情况,浏览器默认打开 yournamespace$Person.edit
屏幕。您可以使用 setWindowId()
方法指定要为任何操作打开的屏幕。
查看您的 screens.xml
文件,找出哪些屏幕使用哪些标识符注册。 Studio 的屏幕列表中提供了相同的信息。
我有:
- 标准的个人浏览器屏幕
- 人物编辑器框架
- 一个人物编辑器屏幕,其中仅包含人物编辑器框架
出于某种原因,当我从浏览器打开编辑器时,我面对的是一个不是我期望的屏幕,我没有设计。上述屏幕似乎是即时自动生成的。
框架设计(映射到人员编辑-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>
嵌入框架的屏幕(映射到人-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"/>
standard actions 在选择要打开的屏幕时使用以下约定:
{entity_name}.edit
用于打开编辑器屏幕{entity_name}.lookup
和{entity_name}.browse
用于打开查找屏幕
对于您的情况,浏览器默认打开 yournamespace$Person.edit
屏幕。您可以使用 setWindowId()
方法指定要为任何操作打开的屏幕。
查看您的 screens.xml
文件,找出哪些屏幕使用哪些标识符注册。 Studio 的屏幕列表中提供了相同的信息。