ofbiz实战——课程管理界面以及代码实现

来源:互联网 发布:python常用包 编辑:程序博客网 时间:2024/05/20 11:25

课程管理主要有:查询,修改,删除,添加功能。

查询:


新增:


修改:



CourseScreens.xml

<?xml version="1.0" encoding="UTF-8"?><screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        xmlns="http://ofbiz.apache.org/Widget-Screen" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Screen http://ofbiz.apache.org/dtds/widget-screen.xsd"><screen name="FindCourse">        <section>            <actions>                <set field="titleProperty" value="CourseManange"/><set field="headerItem" value="CourseManange"/>                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>                <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>            </actions>            <widgets>                <decorator-screen name="CommonBookingDecorator" location="component://booking/widget/booking/CommonScreens.xml">                    <decorator-section name="body">                        <section>                            <widgets>                                <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">                                    <decorator-section name="menu-bar">                                        <container style="button-bar">                                            <link target="EditCourse" text="${uiLabelMap.EditCourse}" style="buttontext"/>                                        </container>                                    </decorator-section>                                    <decorator-section name="search-options">                                        <include-form name="FindCourse" location="component://booking/widget/booking/CourseForms.xml"/>                                    </decorator-section>                                    <decorator-section name="search-results">                                        <include-form name="ListFindCourse" location="component://booking/widget/booking/CourseForms.xml"/>                                    </decorator-section>                                </decorator-screen>                            </widgets>                        </section>                    </decorator-section>                </decorator-screen>            </widgets>        </section>    </screen><screen name="EditCourse">        <section>            <actions>                <set field="titleProperty" value="CourseManange"/>                <set field="headerItem" value="CourseManange"/><entity-one entity-name="Course" value-field="course"/>            </actions>            <widgets>                <decorator-screen name="CommonBookingDecorator" location="${parameters.mainDecoratorLocation}">                    <decorator-section name="body"><container style="button-bar"><link target="FindCourse" text="${uiLabelMap.CommonBack}" style="buttontext"/></container>                        <screenlet title="${groovy: parameters.courseId ? uiLabelMap.CommonEdit : uiLabelMap.CommonAdd}">                            <include-form name="EditCourse" location="component://booking/widget/booking/CourseForms.xml"/>                        </screenlet>                    </decorator-section>                </decorator-screen>            </widgets>        </section>    </screen><screen name="LookupCourse">        <section>            <actions>                <property-map resource="BookingUiLabels" map-name="uiLabelMap" global="true"/>                <set field="title" value="${uiLabelMap.PageTitleLookupCourse}"/>                <set field="queryString" from-field="result.queryString"/>                <set field="entityName" value="Course"/>                <set field="searchFields" value="[courseId, courseName]"/>            </actions>            <widgets>                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">                    <decorator-section name="search-options">                        <include-form name="LookupCourse" location="component://booking/widget/booking/CourseForms.xml"/>                    </decorator-section>                    <decorator-section name="search-results">                        <include-form name="ListLookupCourse" location="component://booking/widget/booking/CourseForms.xml"/>                    </decorator-section>                </decorator-screen>            </widgets>        </section>    </screen></screens>

CourseForms.xml

<?xml version="1.0" encoding="UTF-8"?><forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xmlns="http://ofbiz.apache.org/Widget-Form" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Form http://ofbiz.apache.org/dtds/widget-form.xsd">        <form name="FindCourse" target="FindCourse" title="" type="single"        header-row-style="header-row" default-table-style="basic-table">        <field name="courseName" title="${uiLabelMap.BookingCourseName}"><text-find/></field>        <field name="submitButton" title="${uiLabelMap.CommonFind}"><submit/></field>    </form>    <form name="ListFindCourse" list-name="listIt" title="" type="list" paginate-target="FindCourse"        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">        <actions>            <service service-name="performFind" result-map="result" result-map-list="listIt">                <field-map field-name="inputFields" from-field="requestParameters"/>                <field-map field-name="entityName" value="Course"/>                <field-map field-name="viewIndex" from-field="viewIndex"/>                <field-map field-name="viewSize" from-field="viewSize"/><field-map field-name="noConditionFind" value="Y"/>            </service>        </actions><field name="courseId" title="${uiLabelMap.BookingCourseId}"><display/></field>        <field name="courseName" title="${uiLabelMap.BookingCourseName}"><display/></field><field name="updateLink" title=" " widget-style="buttontext">            <hyperlink description="${uiLabelMap.CommonUpdate}" target="EditCourse" >                <parameter param-name="courseId"/>            </hyperlink>        </field>        <field name="deleteLink" title=" " widget-style="buttontext">            <hyperlink description="${uiLabelMap.CommonDelete}" target="deleteCourse" also-hidden="false">                <parameter param-name="courseId"/>            </hyperlink>        </field>            </form><form name="EditCourse" target="updateCourse" title="" type="single" header-row-style="header-row" default-table-style="basic-table" default-map-name="course" default-entity-name="Course"><alt-target use-when="course==null" target="createCourse"/><auto-fields-service service-name="updateCourse" map-name=""/><field use-when="course!=null" name="courseId" title="${uiLabelMap.BookingCourseId}" tooltip="${uiLabelMap.BookingNotModification}." ><display/></field>        <field use-when="course==null" name="courseId" title="${uiLabelMap.BookingCourseId}" ><text size="20" maxlength="20" /></field><field name="courseName" title="${uiLabelMap.BookingCourseName}"><text size="20" maxlength="20" /></field>        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit/></field>    </form><form name="LookupCourse" target="LookupCourse" title="" type="single"        header-row-style="header-row" default-table-style="basic-table">        <!-- <auto-fields-entity entity-name="Course" default-field-type="hidden"/> -->        <field name="courseName" title="${uiLabelMap.BookingCourseName}"><text-find/></field>        <field name="submitButton" title="${uiLabelMap.CommonFind}"><submit/></field>    </form>    <form name="ListLookupCourse" list-name="listIt" title="" type="list" paginate-target="LookupCourse"        odd-row-style="alternate-row" default-table-style="basic-table" view-size="20">       <actions>            <service service-name="performFind" result-map="result" result-map-list="listIt">                <field-map field-name="inputFields" from-field="requestParameters"/>                <field-map field-name="entityName" value="Course"/>                <field-map field-name="viewIndex" from-field="viewIndex"/>                <field-map field-name="viewSize" from-field="viewSize"/><field-map field-name="noConditionFind" value="Y"/>            </service>        </actions><field name="courseId" title="${uiLabelMap.BookingCourseId}" widget-style="buttontext">  <hyperlink description="${courseId}" target="javascript:set_value('${courseId}')" also-hidden="false" target-type="plain"/>  </field>        <field name="courseName" title="${uiLabelMap.BookingCourseName}"><display/></field>    </form></forms>
返回导航页




阅读全文
0 0
原创粉丝点击