工作框架各种使用整理 -- 展示数据列表并做update
2016-07-26 16:12
459 查看
<!--ProductCategory.xml--> <?xml version="1.0" encoding="UTF-8"?> <screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-2.0.xsd" default-menu-title="ProductCategory" default-menu-index="1"> <subscreens default-item="ProductCategoryList"/> <widgets> <subscreens-panel id="productCategory-panel" type="popup" title="ProductCategory"/> </widgets> </screen>
<!--ProductCategoryList.xml--> <?xml version="1.0" encoding="UTF-8"?> <screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-2.0.xsd" default-menu-title="ProductCategoryList" default-menu-index="1"> <transition name="editProductCategoryContent"><default-response url="../EditProductCategoryContent"/></transition> <actions> <entity-find entity-name="mantle.product.category.ProductCategory" list="productCategoryList"> <search-form-inputs /> </entity-find> </actions> <widgets> <form-list name="ListProductCategory" list="productCategoryList"> <field name="productCategoryId"> <default-field> <link url="editProductCategoryContent" text="${productCategoryId}"/> </default-field> </field> <auto-fields-entity entity-name="mantle.product.category.ProductCategory" field-type="find-display" include="nonpk"/> </form-list> </widgets> </screen>
<!--EditProductCategoryContent.xml--> <?xml version="1.0" encoding="UTF-8"?> <screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/xml-screen-2.0.xsd" default-menu-title="ProductCategoryList" default-menu-index="1"> <parameter name="productCategoryId" required="true"/> <transition name="updateProductCategoryContent"><service-call name="update#mantle.product.category.ProductCategoryContent"/> <default-response url="."/></transition> <transition name="deleteProductCategoryContent"><service-call name="delete#mantle.product.category.ProductCategoryContent"/> <default-response url="."/></transition> <transition name="uploadProductCategoryContent"> <actions><script><![CDATA[ import org.moqui.context.ResourceReference org.moqui.context.ExecutionContext ec = context.ec org.apache.commons.fileupload.FileItem contentFile = context.contentFile String fileName = contentFile.getName() ec.logger.info("Uploading file [${fileName}] for ProductCategory [${productCategoryId}] in repository [${repositoryName}] with content type [${categoryContentTypeEnumId}] and locale [${locale}]") // String contentLocation = "content://${repositoryName}/mantle/ProductCategory/${productCategoryId}/content/${fileName}" String contentLocation = "dbresource://mantle/productCategory/${productCategoryId}/content/${fileName}" ResourceReference newRr = ec.resource.getLocationReference(contentLocation) InputStream fileStream = contentFile.getInputStream() newRr.putStream(fileStream) fileStream.close() ec.service.sync().name("create", "mantle.product.category.ProductCategoryContent").parameters([productCategoryId: productCategoryId, contentLocation: contentLocation, categoryContentTypeEnumId: categoryContentTypeEnumId, locale: locale]).call() ]]></script></actions> <default-response url="."/> </transition> <actions> <entity-find entity-name="mantle.product.category.ProductCategoryContent" list="productCategoryContentList"> <econdition field-name="productCategoryId" from="productCategoryId"/> <order-by field-name="contentLocation"/> </entity-find> </actions> <widgets> <container> <container-dialog id="UploadCategoryContentDialog" button-text="Upload Content"> <form-single name="UploadCategoryProductContent" transition="uploadProductCategoryContent"> <field name="productCategoryId"><default-field><hidden/></default-field></field> <field name="contentFile"><default-field><file/></default-field></field> <field name="categoryContentTypeEnumId"><default-field> <drop-down><entity-options> <entity-find entity-name="moqui.basic.Enumeration"> <econdition field-name="enumTypeId" value="ProductCategoryContentType"/> <order-by field-name="description"/> </entity-find> </entity-options></drop-down> </default-field></field> <field name="locale"><default-field><text-line size="6"/></default-field></field> <field name="submitButton"><default-field><submit confirmation="Really Add?"/></default-field></field> </form-single> </container-dialog> </container> <form-list name="ListProductCategoryContent" transition="updateProductCategoryContent" list="productCategoryContentList"> <field name="productCategoryContentId"><default-field><display/></default-field></field> <field name="productCategoryId"><default-field><display/></default-field></field> <field name="contentLocation"><default-field title="Location"><display/></default-field></field> <field name="categoryContentTypeEnumId"><default-field title="Content Type"> <drop-down><entity-options><entity-find entity-name="moqui.basic.Enumeration"> <econdition field-name="enumTypeId" value="ProductCategoryContentType"/> <order-by field-name="description"/> </entity-find></entity-options></drop-down> </default-field></field> <field name="locale"><default-field><text-line size="6"/></default-field></field> <field name="submitButton"><default-field title="Update"><submit/></default-field></field> <field name="deleteLink"> <default-field title=" "> <!-- the parameters for this will be auto-mapped: productId, contentLocation --> <link url="deleteProductCategoryContent" text="Delete" confirmation="Really Delete?"/> </default-field> </field> </form-list> </widgets> </screen>
相关文章推荐
- c语言链表
- [kafka] 003_kafka_主要配置
- hdu3062 2-sat
- android横竖屏切换
- C基本常识
- Windows下Python开发环境搭建及 Python的HelloWorld示例
- 关于无法使用xx-pc附加到应用程序iisexpress.exe
- 关于无法使用xx-pc附加到应用程序iisexpress.exe
- Linux:管理动态链接库
- 接口和抽象类的对比
- ffmpeg opencv 打开视频文件,并且播放
- sudo: must be setuid root解决办法
- 字符串(后缀自动机):USACO Dec10 恐吓信
- TCP协议中的重传、慢启动、SACK、窗口的概念
- HAproxy编译安装
- WebRTC 介绍 (转)
- (原)代码块
- iOS UITableViewCell滑动删除
- 华为上机:对数计数器
- 自定义Vie