首页 > 解决方案 > search-form-inputs 标记无法与 econditions 一起正常工作

问题描述

我正在使用 econditions 进行实体查找,并将结果列表放在页面上的 form-list 元素中。我想要对列进行排序的能力,所以我在<search-form-inputs/>实体查找的末尾放了一个标签。问题是实体查找对于我所包含的条件不能正常工作(它的结果不是他们应该的!)

当我删除<search-form-inputs/>标签时,一切正常。有什么建议么?也许我没有以正确的方式使用这个标签。

                   <entity-find entity-name="me.myJointView" list="itmTemp" distinct="true">
                    <econdition field-name="myId" operator="less-equals" from="rNTo" ignore-if-empty="true"/>
                    <econdition field-name="myId" operator="greater-equals" from="rNFrom" ignore-if-empty="true"/>
                    <econdition field-name="myName" from="fName" ignore-if-empty="true"/>
                    <econdition field-name="mySurname" from="lName" ignore-if-empty="true"/>
                    <econdition field-name="myDate" operator="less-equals" from="aDTo" ignore-if-empty="true"/>
                    <econdition field-name="someId" operator="equals" from="so" ignore-if-empty="true"/>
                    <econdition field-name="someOtherId" operator="equals" from="rm" ignore-if-empty="true"/>
                    <econditions combine="or">
                        <econdition field-name="myStateEnumId" operator="equals" value="something"/>
                        <econdition field-name="myStateEnumId" operator="equals" value="somethingElse"/>
                    </econditions>
                    <econditions combine="or">
                        <econditions combine="and">
                            <econdition field-name="aDate" from="null"/>
                            <econdition field-name="myDate" operator="greater-equals" to-field-name="aDate"/>
                        </econditions>
                        <econditions combine="and">
                            <econdition field-name="myDate" operator="less-equals" to-field-name="dDate"/>
                            <econdition field-name="myDate" operator="greater-equals" to-field-name="aDate"/>
                        </econditions>
                    </econditions>
                    <search-form-inputs/>
                    <select-field field-name="myId"/>
                    <select-field field-name="myName"/>
                    <select-field field-name="mySurname"/>
                    <select-field field-name="MyDate"/>
                    <order-by field-name="myDate,RECETEST.lastUpdatedStamp"/>
                </entity-find>

标签: moqui

解决方案


看看你的上下文中的内容,你会确切地看到引发这种行为的情况。(例如,您可以使用屏幕上的“标签”标签返回“== ${context} ==”等)。

如果您只想要列排序,则制作您自己的输入字段映射,如 [orderByField:ec.web.parameters.orderByField],并将您的默认排序方式也放入搜索表单输入中。

<search-form-inputs input-fields-map="xxx" default-order-by="xxx" />

推荐阅读