You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Jacopo Cappellato <ti...@sastau.it> on 2007/03/16 17:29:55 UTC

Need help with Or condition and performFind in form widget

Hi all,

I'm struggling with the following form definition:

<form name="ApproveRequirements" type="multi" use-row-submit="true" 
target="approveRequirements" title="" list-name="listIt"
paginate-target="ApproveRequirements">
  <actions>
   <set field="entityName" value="Requirement"/>
   <set field="requestParameters.statusId" value="REQ_CREATED"/>
   <service service-name="performFind" result-map-name="result"
                                  result-map-list-name="listIt">
    <field-map field-name="inputFields" env-name="requestParameters"/>
    <field-map field-name="entityName" env-name="entityName"/>
   </service>
  </actions>
...

Now I need to change it to filter by statusId=REQ_CREATED OR 
statusId=REQ_PROPOSED

Is there a way to do this?

Please help,

Jacopo

Re: Need help with Or condition and performFind in form widget

Posted by Jacopo Cappellato <ti...@sastau.it>.
David,

I will probably try with your former suggestion... the issue with the 
latter is that some of the constraints are received from a search form, 
and I was hoping to not deal with all of them.

Thanks,

Jacopo

David E. Jones wrote:
> 
> One thing you can do is prepare the condition list separately and then 
> use the executeFind service to run it.
> 
> Of course, you course you can always use entity-condition to manually 
> map and run everything.
> 
> -David
> 
> 
> On Mar 16, 2007, at 10:29 AM, Jacopo Cappellato wrote:
> 
>> Hi all,
>>
>> I'm struggling with the following form definition:
>>
>> <form name="ApproveRequirements" type="multi" use-row-submit="true" 
>> target="approveRequirements" title="" list-name="listIt"
>> paginate-target="ApproveRequirements">
>>  <actions>
>>   <set field="entityName" value="Requirement"/>
>>   <set field="requestParameters.statusId" value="REQ_CREATED"/>
>>   <service service-name="performFind" result-map-name="result"
>>                                  result-map-list-name="listIt">
>>    <field-map field-name="inputFields" env-name="requestParameters"/>
>>    <field-map field-name="entityName" env-name="entityName"/>
>>   </service>
>>  </actions>
>> ...
>>
>> Now I need to change it to filter by statusId=REQ_CREATED OR 
>> statusId=REQ_PROPOSED
>>
>> Is there a way to do this?
>>
>> Please help,
>>
>> Jacopo
> 



Re: Need help with Or condition and performFind in form widget

Posted by "David E. Jones" <jo...@hotwaxmedia.com>.
One thing you can do is prepare the condition list separately and  
then use the executeFind service to run it.

Of course, you course you can always use entity-condition to manually  
map and run everything.

-David


On Mar 16, 2007, at 10:29 AM, Jacopo Cappellato wrote:

> Hi all,
>
> I'm struggling with the following form definition:
>
> <form name="ApproveRequirements" type="multi" use-row-submit="true"  
> target="approveRequirements" title="" list-name="listIt"
> paginate-target="ApproveRequirements">
>  <actions>
>   <set field="entityName" value="Requirement"/>
>   <set field="requestParameters.statusId" value="REQ_CREATED"/>
>   <service service-name="performFind" result-map-name="result"
>                                  result-map-list-name="listIt">
>    <field-map field-name="inputFields" env-name="requestParameters"/>
>    <field-map field-name="entityName" env-name="entityName"/>
>   </service>
>  </actions>
> ...
>
> Now I need to change it to filter by statusId=REQ_CREATED OR  
> statusId=REQ_PROPOSED
>
> Is there a way to do this?
>
> Please help,
>
> Jacopo


Re: Need help with Or condition and performFind in form widget

Posted by Chris Howe <cj...@yahoo.com>.
I don't believe the performFind service supports or conditionals. 
Without changing the performFind service, you can either use
entity-condition or run an additional service or script to filter your
performFind result set or a row-action script to go to the next
iteration if it doesn't meet your criteria perhaps.

--- Jacopo Cappellato <ti...@sastau.it> wrote:

> Hi all,
> 
> I'm struggling with the following form definition:
> 
> <form name="ApproveRequirements" type="multi" use-row-submit="true" 
> target="approveRequirements" title="" list-name="listIt"
> paginate-target="ApproveRequirements">
>   <actions>
>    <set field="entityName" value="Requirement"/>
>    <set field="requestParameters.statusId" value="REQ_CREATED"/>
>    <service service-name="performFind" result-map-name="result"
>                                   result-map-list-name="listIt">
>     <field-map field-name="inputFields"
> env-name="requestParameters"/>
>     <field-map field-name="entityName" env-name="entityName"/>
>    </service>
>   </actions>
> ...
> 
> Now I need to change it to filter by statusId=REQ_CREATED OR 
> statusId=REQ_PROPOSED
> 
> Is there a way to do this?
> 
> Please help,
> 
> Jacopo
>