学期管理主要有:查询,修改,删除,添加功能。
界面如下:
查询:
新增:
修改:
相关代码如下:
配置TermScreens.xm
<?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="FindTerm">
<section>
<actions>
<set field="titleProperty" value="TermManange"/>
<set field="headerItem" value="TermManange"/>
<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="EditTerm" text="${uiLabelMap.EditTerm}" style="buttontext"/>
</container>
</decorator-section>
<decorator-section name="search-options">
<include-form name="FindTerm" location="component://booking/widget/booking/TermForms.xml"/>
</decorator-section>
<decorator-section name="search-results">
<include-form name="ListFindTerm" location="component://booking/widget/booking/TermForms.xml"/>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="EditTerm">
<section>
<actions>
<set field="titleProperty" value="TermManange"/>
<set field="headerItem" value="TermManange"/>
<!--<set field="termName" value="${parameters.termName}"/>-->
<entity-one entity-name="Term" value-field="term"/>
</actions>
<widgets>
<decorator-screen name="CommonBookingDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<container style="button-bar">
<link target="FindTerm" text="${uiLabelMap.CommonBack}" style="buttontext"/>
</container>
<screenlet title="${groovy: parameters.termName ? uiLabelMap.CommonEdit : uiLabelMap.CommonAdd}">
<include-form name="EditTerm" location="component://booking/widget/booking/TermForms.xml"/>
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="LookupTerm">
<section>
<actions>
<property-map resource="BookingUiLabels" map-name="uiLabelMap" global="true"/>
<set field="title" value="${uiLabelMap.PageTitleLookupTerm}"/>
<set field="queryString" from-field="result.queryString"/>
<set field="entityName" value="Term"/>
<set field="searchFields" value="[termName]"/>
</actions>
<widgets>
<decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
<decorator-section name="search-options">
<include-form name="LookupTerm" location="component://booking/widget/booking/TermForms.xml"/>
</decorator-section>
<decorator-section name="search-results">
<include-form name="ListLookupTerm" location="component://booking/widget/booking/TermForms.xml"/>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
</screens>
<?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="FindTerm" target="FindTerm" title="" type="single"
header-row-style="header-row" default-table-style="basic-table">
<field name="termName" title="${uiLabelMap.TermTermName}"><text-find/></field>
<field name="used" title="${uiLabelMap.TermUsed}">
<drop-down allow-empty="true" >
<option key="Y" description="${uiLabelMap.CommonYes}"/>
<option key="N" description="${uiLabelMap.CommonNo}"/>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonFind}"><submit/></field>
</form>
<form name="ListFindTerm" list-name="listIt" title="" type="list" paginate-target="FindTerm"
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="Term"/>
<field-map field-name="viewIndex" from-field="viewIndex"/>
<field-map field-name="viewSize" from-field="viewSize"/>
<field-map field-name="orderBy" value="beginTime"/>
<field-map field-name="noConditionFind" value="Y"/>
</service>
</actions>
<field name="termName" title="${uiLabelMap.TermTermName}"><display/></field>
<field name="beginTime" title="${uiLabelMap.TermBeginTime}"><display/></field>
<field name="endTime" title="${uiLabelMap.TermEndTime}"><display/></field>
<field name="used" title="${uiLabelMap.TermUsed}">
<display description="${groovy: used == 'Y' ? uiLabelMap.CommonYes : uiLabelMap.CommonNo}"/>
</field>
<field name="updateLink" title=" " widget-style="buttontext">
<hyperlink description="${uiLabelMap.CommonUpdate}" target="EditTerm" >
<parameter param-name="termName"/>
</hyperlink>
</field>
<field name="deleteLink" title=" " widget-style="buttontext">
<hyperlink description="${uiLabelMap.CommonDelete}" target="deleteTerm" also-hidden="false">
<parameter param-name="termName"/>
</hyperlink>
</field>
</form>
<form name="EditTerm" target="updateTerm" title="" type="single" header-row-style="header-row"
default-table-style="basic-table" default-map-name="term" default-entity-name="Term">
<alt-target use-when="term==null" target="createTerm"/>
<auto-fields-service service-name="updateTerm" map-name=""/>
<field use-when="term!=null" name="termName" title="${uiLabelMap.TermTermName}" tooltip="${uiLabelMap.BookingNotModification}." ><display/></field>
<field use-when="term==null" name="termName" title="${uiLabelMap.TermTermName}" required-field="true"><text size="20" maxlength="20" /></field>
<field name="beginTime" title="${uiLabelMap.TermBeginTime}" required-field="true"><date-time type="date" /></field>
<field name="endTime" title="${uiLabelMap.TermEndTime}" ><date-time type="date" /></field>
<field name="used" title="${uiLabelMap.TermUsed}">
<drop-down allow-empty="false" no-current-selected-key="Y">
<option key="Y" description="${uiLabelMap.CommonYes}"/>
<option key="N" description="${uiLabelMap.CommonNo}"/>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonSubmit}">
<submit/>
</field>
</form>
<form name="LookupTerm" target="LookupTerm" title="" type="single"
header-row-style="header-row" default-table-style="basic-table">
<!-- <auto-fields-entity entity-name="Term" default-field-type="hidden"/> -->
<field name="termName" title="${uiLabelMap.TermTermName}"><text-find/></field>
<field name="used" title="${uiLabelMap.TermUsed}">
<drop-down allow-empty="true" >
<option key="Y" description="${uiLabelMap.CommonYes}"/>
<option key="N" description="${uiLabelMap.CommonNo}"/>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
<form name="ListLookupTerm" list-name="listIt" title="" type="list" paginate-target="LookupTerm"
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="Term"/>
<field-map field-name="viewIndex" from-field="viewIndex"/>
<field-map field-name="viewSize" from-field="viewSize"/>
<field-map field-name="orderBy" value="beginTime"/>
<field-map field-name="noConditionFind" value="Y"/>
</service>
</actions>
<field name="termName" title="${uiLabelMap.TermTermName}" widget-style="buttontext">
<hyperlink description="${termName}" target="javascript:set_value('${termName}')" also-hidden="false" target-type="plain"/>
</field>
<field name="beginTime" title="${uiLabelMap.TermBeginTime}"><display/></field>
<field name="endTime" title="${uiLabelMap.TermEndTime}"><display/></field>
<field name="used" title="${uiLabelMap.TermUsed}"><display /></field>
</form>
</forms>
返回导航页