ofbiz查找功能关键代码

查询功能不需要minilanguage或java来实现.输入查询条件的表单type为single,target指向的是当前页面,auto-fields-entity元素的type为find.

显示查询结果的表单比较特别,该表单中有action部分,其中的代码就是实现查询功能的代码,具体使用时修改实体名即可.和其它表单一样,可以指定具体域有特殊的显示效果或隐藏.

    <form name="FindPurchaseOrder" target="FindPurchaseOrder" type="single">
        <auto-fields-entity entity-name="ZjPurchaseOrder" default-field-type="find" />
        <field name="submitButton" title="查找" widget-style="smallSubmit">
            <submit button-type="button" />
        </field>
    </form>

 

    <form name="listFindPurchaseOrder" list-name="listIt" title="" type="list" paginate-target="/FindPurchaseOrder" 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="ZjPurchaseOrder" />
            </service>
        </actions>
        <auto-fields-entity entity-name="ZjPurchaseOrder" default-field-type="display" />
    </form>

 

关键点是替换:ZjPurchaseOrder为你自己的实体就可以了;

 

PS:http://jiasudu.iteye.com/blog/105431,加速度的有点老了,2007年的,现在有些小变化了;

你可能感兴趣的:(Blog)