工作框架各种使用整理 -- 展示数据列表并做update
<!--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>
工作框架各种使用整理 -- 展示数据列表并做update的更多相关文章
- 工作框架各种使用整理---使用Cache
<service verb="get" noun="Products"> <implements service="sang.pro ...
- freemarker 展示数据列表并传值给后台
select id="initiatorId" name="initiatorId"> <#if initiato ...
- 从后端到前端之Vue(四)小试牛刀——真实项目的应用(树、tab、数据列表和分页)
学以致用嘛,学了这么多,在真实项目里面怎么应用呢?带着问题去学习才是最快的学习方式.还是以前的那个项目,前后端分离,现在把前端换成vue的,暂时采用脚本化的方式,然后在尝试工程化的方式. 现在先实现功 ...
- 大数据技术之_25_手机APP信息统计系统项目_01_APP 数据生成模块 + 数据收集模块 + 数据处理模块框架搭建 + 业务需求处理 + 数据展示模块 +项目总结 + 问题总结
一 项目概述1.1 角色1.2 业务术语1.3 项目效果展示二 项目需求三 项目概要3.1 项目技术架构3.2 项目目录结构3.3 项目技术选型3.4 项目整体集群规划3.5 创建项目工程四 APP ...
- salesforce lightning零基础学习(七) 列表展示数据时两种自定义编辑页面
上一篇Lightning内容描述的是LDS,通过LDS可以很方便的实例化一个对象的数据信息.当我们通过列表展示数据需要编辑时,我们常使用两种方式去处理编辑页面:Pop Up Window弹出修改详情以 ...
- (第4篇)hadoop之魂--mapreduce计算框架,让收集的数据产生价值
摘要: 通过前面的学习,大家已经了解了HDFS文件系统.有了数据,下一步就要分析计算这些数据,产生价值.接下来我们介绍Mapreduce计算框架,学习数据是怎样被利用的. 博主福利 给大家赠送一套ha ...
- 转载 ASP.NET SignalR 与LayIM配合,轻松实现网站客服聊天室(一) 整理基础数据
ASP.NET SignalR 与LayIM配合,轻松实现网站客服聊天室(一) 整理基础数据 最近碰巧发现一款比较好的Web即时通讯前端组件,layim,百度关键字即可,我下面要做的就是基于这个前 ...
- ElasticSearch(十)Elasticsearch检索出的数据列表按字段匹配的优先顺序及搜索单词拼音一部分搜不到数据
检索出的数据列表按字段匹配的优先顺序 一.举例 比如,发布一篇文章,文章包括基本的字段包括标题.发布时间.点击率.关键字.内容.当在页面中输入“教育”搜索关键词,会检索出指定字段包括“教育”的所有数据 ...
- python操作三大主流数据库(4)python操作mysql④python服务端flask和前端bootstrap框架结合实现新闻展示
python操作mysql④python服务端flask和前端bootstrap框架结合实现新闻展示 参考文档http://flask.pocoo.org/docs/0.11/http://flask ...
随机推荐
- 命令行向php传入参数的两种方法
##$argv or $argc $argv 包含当运行于命令行下时传递给当前脚本的参数的数组. $argv[0] 就是脚本文件名. $argc 包含当运行于命令行下时传递给当前脚本的参数的数目 ...
- 关于TCP连接建立与终止那点事
0. 前言 最近在处理公司遗留项目的时候发现自己对TCP协议一点都不懂,所以补了点关于TCP连接的建立和终止的内容,这里简单写下自己了解的部分,省略了报文序号确认序号这些无关的字段,主要讨论TCP状态 ...
- Python Select 解析
首先列一下,sellect.poll.epoll三者的区别 select select最早于1983年出现在4.2BSD中,它通过一个select()系统调用来监视多个文件描述符的数组,当select ...
- 再不写,我怕就再也不写了-LAMP基础
hi 经历了4天大餐的洗礼,整个人都思密达了...昨天的懒,是没有原因的懒,总之就是该提笔了亲 1.Ubuntu下的LAMP配置 -----Ubuntu基础知识----- ----管理员权限 出于安全 ...
- MVC、MVVM、MVP小结
MVC MVC(Mode View Controller)是一种设计模式,它将应用划分为三个部分: 数据(模型).展现层(视图).用户交互(控制器). 一个事件发生的过程: ① 用户和应用产生交互 ② ...
- 怎么解决ZBrush保存历史记录太多问题
经常有用户反映说ZBrush ®保存历史记录太多了,导致文件太大了!模型已经是降低级别保存了,在保存历史记录的时候还是很慢很慢,不知道怎么才能减少ZBrush保存的历史步骤的多少.针对这一问题,小编统 ...
- (七)中介者模式-C++实现
用一个中介对象来封装一系列的对象交互.中介者使各对象不需要显示地相互引用,从而使其解耦合松散而且可以独立地改变他们之间的交互. 中介者模式适合于 系统中不希望对象之间直接交互,即不希望类之间相互包含, ...
- Windows 批处理(bat)语法大全
本文是学习bat整理的笔记,由于内容较多,建议结合右侧文章大纲查看. %~dp0[获取当前路径] %~dp0 “d”为Drive的缩写,即为驱动器,磁盘.“p”为Path缩写,即为路径,目录 cd % ...
- 重写成员“log4net.Util.ReadOnlyPropertiesDictionary.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)”时违反了继承安全性规则
在.NET 4.0下使用最新版本的log4Net 1.2.10,会遇到下面这样的错误: 重写成员“log4net.Util.ReadOnlyPropertiesDictionary.GetObject ...
- sublime安装package control组件
第一步,首先到这个网站https://packagecontrol.io/installation去下载Package Control.sublime-package文件 第二步,将下载的文件放到C: ...