标签:
添加一个新建表单
<!--新增 列表 --> <transition> <service-call name="create#Tutorial"/> <default-response url="."/> </transition>
<container-dialog id="CreateTutorialDialog" button-text="Create Tutorial"> <form-single name="CreateTutorial" transition="createTutorial"> <auto-fields-entity entity-name="Tutorial" field-type="edit"/> <field name="submitButton"> <default-field title="Create"> <submit/> </default-field> </field> </form-single> </container-dialog>
<container-dialog id="CreateTutorialDialog" button-text="Create Tutorial"> <form-single name="CreateTutorial" transition="createTutorial"> <auto-fields-entity entity-name="Tutorial" field-type="edit"/> <field name="submitButton"> <default-field title="Create"> <submit/> </default-field> </field> </form-single> </container-dialog>
<transition name="createTutorial"> <service-call name="tutorial.TutorialServices.create#Tutorial"/> <default-response url="."/> </transition>
<service verb="create" noun="Tutorial" type="script" location="component://tutorial/script/createTutorial.grovvy"> <in-parameters> <auto-parameters include="all"/> </in-parameters> <out-parameters> <out-parameters> <auto-parameters include="pk" required="true"/> </out-parameters> </out-parameters> </service>
EntityValue tutorial=ec.entity.makeValue("Tutorial") tutorial.setAll(context) if(!tutorial.tutorialId)tutorial.setSequencedIdPrimary() tutorial.create()
标签:
原文地址:http://www.cnblogs.com/dream-to-pku/p/5462454.html