配置AdminScreens.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="FindAdmin">
<section>
<actions>
<set field="titleProperty" value="AdminManange"/>
<set field="headerItem" value="AdminManange"/>
<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="EditAdmin" text="${uiLabelMap.EditAdmin}" style="buttontext"/>
</container>
</decorator-section>
<decorator-section name="search-options">
<include-form name="FindAdmin" location="component://booking/widget/booking/AdminForms.xml"/>
</decorator-section>
<decorator-section name="search-results">
<include-form name="ListFindAdmin" location="component://booking/widget/booking/AdminForms.xml"/>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="EditAdmin">
<section>
<actions>
<set field="titleProperty" value="TchInfoManange"/>
<set field="headerItem" value="TchInfoManange"/>
<entity-one entity-name="Admin" value-field="admin"/>
</actions>
<widgets>
<decorator-screen name="CommonBookingDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<container style="button-bar">
<link target="FindAdmin" text="${uiLabelMap.CommonBack}" style="buttontext"/>
</container>
<screenlet title="${groovy: parameters.tchId ? uiLabelMap.CommonEdit : uiLabelMap.CommonAdd}">
<include-form name="EditAdmin" location="component://booking/widget/booking/AdminForms.xml"/>
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
</screens>
配置AdminForms.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="FindAdmin" target="FindAdmin" title="" type="single"
header-row-style="header-row" default-table-style="basic-table">
<field name="name" title="${uiLabelMap.BookingName}"><text-find/></field>
<field name="submitButton" title="${uiLabelMap.CommonFind}"><submit/></field>
</form>
<form name="ListFindAdmin" list-name="listIt" title="" type="list" paginate-target="FindAdmin"
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="Admin"/>
<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="adminId" title="${uiLabelMap.BookingAdminId}"><display/></field>
<field name="name" title="${uiLabelMap.BookingName}"><display/></field>
<field name="deptName" title="${uiLabelMap.BookingAdminDeptName}"><display/></field>
<field name="sex" title="${uiLabelMap.BookingSex}">
<display description="${groovy: sex == 'Male' ? uiLabelMap.CommonMale : (sex == 'Female' ? uiLabelMap.CommonFemale : ' ')}"/>
</field>
<field name="resetPassword" title=" " widget-style="buttontext">
<hyperlink description="${uiLabelMap.BookingResetPassword}" target="resetPasswordForAdmin" >
<parameter param-name="userLoginId" from-field="stuId"/>
</hyperlink>
</field>
<field name="updateLink" title=" " widget-style="buttontext">
<hyperlink description="${uiLabelMap.CommonUpdate}" target="EditAdmin" >
<parameter param-name="adminId"/>
</hyperlink>
</field>
<field name="deleteLink" title=" " widget-style="buttontext">
<hyperlink description="${uiLabelMap.CommonDelete}" target="deleteAdmin" also-hidden="false">
<parameter param-name="adminId"/>
</hyperlink>
</field>
</form>
<form name="EditAdmin" target="updateAdmin" title="" type="single" header-row-style="header-row"
default-table-style="basic-table" default-map-name="admin" default-entity-name="Admin">
<alt-target use-when="admin==null" target="createAdmin"/>
<auto-fields-service service-name="updateAdmin" map-name=""/>
<field use-when="admin!=null" name="adminId" title="${uiLabelMap.BookingAdminId}" tooltip="${uiLabelMap.BookingNotModification}." ><display/></field>
<field use-when="admin==null" name="adminId" title="${uiLabelMap.BookingAdminId}" required-field="true"><text size="20" maxlength="20" /></field>
<field name="name" title="${uiLabelMap.BookingName}" required-field="true"><text size="20" maxlength="20" /></field>
<field name="deptName" title="${uiLabelMap.BookingAdminDeptName}" ><text size="20" maxlength="20" /></field>
<field name="sex" title="${uiLabelMap.BookingSex}">
<drop-down allow-empty="false" >
<option key="Male" description="${uiLabelMap.CommonMale}"/>
<option key="Female" description="${uiLabelMap.CommonFemale}"/>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonSubmit}">
<submit/>
</field>
</form>
</forms>
返回导航页