搜索无效(如预期)列表格式PartyListForm - 从mantle.party.PartyIdentification加载的列

时间:2016-08-04 20:17:46

标签: moqui

我首先在FindParty.xml中使用PartyListForm。此列表加载与各方相关的数据,在我的情况下加载供应商角色。我添加了一个带有来自mantle.party.PartyIdentification的ID的新列,其中包含特定的 partyIdTypeEnumId 。结果令人满意,我有一份供应商清单,显示了他们的名字和各自的ID。当我想让用户搜索这些ID时,问题就开始了。这是行不通的。这是该列的定义:

                <field name="idValue">
                    <header-field title="Company ID" show-order-by="true">
                        <text-find size="30" hide-options="true"/>
                    </header-field>
                    <default-field>
                        <display text="${partyIdentification?.idValue?:'N/a'}" text-map="partyIdentification"/>
                    </default-field>
                </field>

这是数据(text-map =“partyIdentification”)的来源:

                <row-actions>
                    <entity-find-one entity-name="mantle.party.PartyDetail" value-field="party"/>
                    <entity-find-one entity-name="mantle.party.PartyIdentification" value-field="partyIdentification">
                        <field-map field-name="partyId" from="partyId"/>
                        <field-map field-name="partyIdTypeEnumId" value="PtidICO"/>
                    </entity-find-one>
                    <entity-find-count entity-name="mantle.party.PartyInvoiceDetail" count-field="invCount">
                        <econdition field-name="partyId" operator="equals" from="partyId"/>
                    </entity-find-count>
                </row-actions>

This is how it looks on the screen

@ David的评论:

原始搜索被注释掉了,我的尝试:

        <!--<service-call name="mantle.party.PartyServices.find#Party" in-map="context + [leadingWildcard:true, orderByField:'^organizationName', roleTypeId:'Supplier', pageSize:7]" out-map="context"/>-->
    <service-call name="mantle.party.PartyServicesEnhancements.findEnhanced#Party" in-map="context + [leadingWildcard:true, orderByField:'^organizationName', roleTypeId:'Supplier', pageSize:7]" out-map="context"/>

1 个答案:

答案 0 :(得分:0)

我通过添加新组件作为现有组件的副本进行了一些更改,即:

  1. new view-entity with entity-name =&#34; FindPartyViewEnhanced&#34; in package =&#34; mantle.party作为&#34; FindPartyView&#34;的副本添加这些内容:

    <member-entity entity-alias="IDNTF" entity-name="PartyIdentification" join-from-alias="PTY"> <key-map field-name="partyId" related="partyId" /> <entity-condition> <econdition field-name="partyIdTypeEnumId" operator="equals" value="PtidICO"/> </entity-condition> </member-entity>

    <alias entity-alias="IDNTF" name="idValue" field="idValue"/> <alias entity-alias="IDNTF" name="partyIdTypeEnumId" field="partyIdTypeEnumId"/>

  2. 新服务&#34; findEnhanced&#34;名词=&#34;方&#34;类型=&#34;脚本&#34;作为find#Party服务的副本添加了新参数:

  3. <parameter name="idValue"/>

    1. new findPartyEnhanced.groovy(findParty.groovy的副本)添加了一行:
    2. if (idValue) { ef.condition(ec.entity.conditionFactory.makeCondition("idValue", EntityCondition.LIKE, (leadingWildcard ? "%" : "") + idValue + "%").ignoreCase()) }

      1. 最后,在搜索所在的屏幕的行动作中,这就是我最终的结果:
      2. <service-call name="mantle.party.PartyServicesEnhancements.findEnhanced#Party" in-map="context + [leadingWildcard:true, idValue:idValue, orderByField:'organizationName', roleTypeId:'Supplier', pageSize:7]" out-map="context"/>

        最有可能的是,这不是最好的解决方案,但它对我有用。希望它也会对你有帮助。