ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Snow <sno...@snowconsulting.co.uk>
Subject Re: Strange behavior in LookupServices.xml#lookupParty?
Date Wed, 06 Jan 2010 12:35:13 GMT
Is this method deprecated - there doesn't appear to be any client code 
using it?

Christopher Snow wrote:
> lookupParty doesn't seem to be working correctly in trunk.  It appears
> that all the values in lookupResult get replaced with the last value
> entered?
>
> Am I going mad???
>
> I have put some debug code (below) and show the results (below)...
>
>    <simple-method method-name="lookupParty" short-description="Lookup a
> party">
>         <if-not-empty field="parameters.firstName">
>             <set from-field="parameters.firstName"
> field="LookupMap.firstName"/>
>         </if-not-empty>
>         <if-not-empty field="parameters.lastName">
>             <set from-field="parameters.lastName"
> field="LookupMap.lastName"/>
>         </if-not-empty>
>        
>         <find-by-and entity-name="Person" map="LookupMap" list="parties"/>
>         <iterate entry="party" list="parties">
>             <set from-field="party.firstName" field="resultEntry.label"/>
>             <set from-field="party.partyId" field="resultEntry.value"/>
>            
>             <log level="info" message=" resultEntry ${resultEntry} "/>
>            
>             <field-to-list field="resultEntry" list="lookupResult"/>
>            
>             <log level="info" message=" lookupResult ${lookupResult} "/>
>         </iterate>
>         <if-empty field="parties">
>             <set value="No match" field="resultEntry.label"/>
>             <set value="" field="resultEntry.value"/>
>             <field-to-list field="resultEntry" list="lookupResult"/>
>         </if-empty>
>         <field-to-result field="lookupResult"/>
>     </simple-method>
>
>
>  resultEntry [label=admin, value=10000]
>  lookupResult [[label=admin, value=10000]]
>  resultEntry [label=John, value=johnsmith]
>  lookupResult [[label=John, value=johnsmith], [label=John,
> value=johnsmith]]
>  resultEntry [label=Paul, value=paulsmith]
>  lookupResult [[label=Paul, value=paulsmith], [label=Paul,
> value=paulsmith], [label=Paul, value=paulsmith]]
>  resultEntry [label=Bob, value=bobsmith]
>  lookupResult [[label=Bob, value=bobsmith], [label=Bob, value=bobsmith],
> [label=Bob, value=bobsmith], [label=Bob, value=bobsmith]]
>  resultEntry [label=Jim, value=jimsmith]
>  lookupResult [[label=Jim, value=jimsmith], [label=Jim, value=jimsmith],
> [label=Jim, value=jimsmith], [label=Jim, value=jimsmith], [label=Jim,
> value=jimsmith]]
>  lookupResult [[label=Jim, value=jimsmith], [label=Jim, value=jimsmith],
> [label=Jim, value=jimsmith], [label=Jim, value=jimsmith], [label=Jim,
> value=jimsmith]]
>
>   


-- 
Chris Snow - CEng MBCS CITP MBA (Tech Mgmt) (Open) CISSP

Tel: 01453 890660
Mob: 07944 880950
Www: www.snowconsulting.co.uk


Mime
View raw message