PerformFind Requests By Multiple Requests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
gp
Reply | Threaded
Open this post in threaded view
|

PerformFind Requests By Multiple Requests

gp
Hi,

I am trying to change the "Find Requests" screen to be able to search  
by multiple status. A part of the change that I did for this on the UI  
is as shown below.

        <field name="statusId">
             <check allow-empty="true">
                 <entity-options entity-name="StatusItem"  
description="${description}">
                     <entity-constraint name="statusTypeId"  
operator="equals" value="CUSTREQ_STTS"/>
                     <entity-order-by field-name="sequenceId"/>
                 </entity-options>
             </check>
         </field>

This renders the status as checkboxes, and with this change I am able  
to select multiple status for performing a search. The service linked  
to the "Find Requests" screen is performFind, which as I understand is  
a generic service used across ofbiz to find various entities.

       <form name="ListRequests" type="list" extends="ListRequestList"  
list-name="listIt">
         <actions>
           <service service-name="performFind" result-map="result"  
result-map-list="listIt">
             <field-map field-name="inputFields" from-field="parameters"/>
             <field-map field-name="entityName" from-field="entityName"/>
             <field-map field-name="orderBy"  
from-field="parameters.sortField"/>
             <field-map field-name="viewIndex" from-field="viewIndex"/>
             <field-map field-name="viewSize" from-field="viewSize"/>
           </service>
         </actions>
     </form>

On debugging performFind, I found that when I select multiple status  
value to perform a find, the multiple status values translate into the  
following entity condition

                                statusId = '{CRQ_SUBMITTED,  
CRQ_ACCEPTED, CRQ_COMPLETED,CRQ_QUOATED}'

This will never return matching resultset since the multiple values  
are combined against a single condition. Ideally the conditions should  
be translated to multiple status values with OR logic, i.e. statusId=  
CRQ_SUBMITTED OR statusId=CRQ_ACCEPTED OR statusId=CRQ_COMPLETED OR  
statusId=CRQ_QUOATED.

Is there anyway I can achieve the above with minimum changes to  
performFind service for such scenarios.

The reason I am not inclined towards building a separate service for  
this behaviour as it would involve a greater impact to the overall  
stable functionality of "Find Requests".

Would greatly appreciate help on this from the community.

Regards
GP

Reply | Threaded
Open this post in threaded view
|

Re: PerformFind Requests By Multiple Requests

Malin Nicolas
Hi GP,

Can you try the operator in ? as like :
<field name="statusId_op"><hidden value="in"/> </field>

Nicolas

Le 05/03/2013 17:51, [hidden email] a écrit :

> Hi,
>
> I am trying to change the "Find Requests" screen to be able to search
> by multiple status. A part of the change that I did for this on the UI
> is as shown below.
>
>        <field name="statusId">
>             <check allow-empty="true">
>                 <entity-options entity-name="StatusItem"
> description="${description}">
>                     <entity-constraint name="statusTypeId"
> operator="equals" value="CUSTREQ_STTS"/>
>                     <entity-order-by field-name="sequenceId"/>
>                 </entity-options>
>             </check>
>         </field>
>
> This renders the status as checkboxes, and with this change I am able
> to select multiple status for performing a search. The service linked
> to the "Find Requests" screen is performFind, which as I understand is
> a generic service used across ofbiz to find various entities.
>
>       <form name="ListRequests" type="list" extends="ListRequestList"
> list-name="listIt">
>         <actions>
>           <service service-name="performFind" result-map="result"
> result-map-list="listIt">
>             <field-map field-name="inputFields" from-field="parameters"/>
>             <field-map field-name="entityName" from-field="entityName"/>
>             <field-map field-name="orderBy"
> from-field="parameters.sortField"/>
>             <field-map field-name="viewIndex" from-field="viewIndex"/>
>             <field-map field-name="viewSize" from-field="viewSize"/>
>           </service>
>         </actions>
>     </form>
>
> On debugging performFind, I found that when I select multiple status
> value to perform a find, the multiple status values translate into the
> following entity condition
>
>                                statusId = '{CRQ_SUBMITTED,
> CRQ_ACCEPTED, CRQ_COMPLETED,CRQ_QUOATED}'
>
> This will never return matching resultset since the multiple values
> are combined against a single condition. Ideally the conditions should
> be translated to multiple status values with OR logic, i.e. statusId=
> CRQ_SUBMITTED OR statusId=CRQ_ACCEPTED OR statusId=CRQ_COMPLETED OR
> statusId=CRQ_QUOATED.
>
> Is there anyway I can achieve the above with minimum changes to
> performFind service for such scenarios.
>
> The reason I am not inclined towards building a separate service for
> this behaviour as it would involve a greater impact to the overall
> stable functionality of "Find Requests".
>
> Would greatly appreciate help on this from the community.
>
> Regards
> GP
>


--
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/

gp
Reply | Threaded
Open this post in threaded view
|

Re: PerformFind Requests By Multiple Requests

gp
Awesome!!!

Thank you so much Nicolas, it worked like a charm.

Regards
GP

Quoting Nicolas Malin <[hidden email]>:

> Hi GP,
>
> Can you try the operator in ? as like :
> <field name="statusId_op"><hidden value="in"/> </field>
>
> Nicolas
>
> Le 05/03/2013 17:51, [hidden email] a écrit :
>> Hi,
>>
>> I am trying to change the "Find Requests" screen to be able to  
>> search by multiple status. A part of the change that I did for this  
>> on the UI is as shown below.
>>
>>       <field name="statusId">
>>            <check allow-empty="true">
>>                <entity-options entity-name="StatusItem"  
>> description="${description}">
>>                    <entity-constraint name="statusTypeId"  
>> operator="equals" value="CUSTREQ_STTS"/>
>>                    <entity-order-by field-name="sequenceId"/>
>>                </entity-options>
>>            </check>
>>        </field>
>>
>> This renders the status as checkboxes, and with this change I am  
>> able to select multiple status for performing a search. The service  
>> linked to the "Find Requests" screen is performFind, which as I  
>> understand is a generic service used across ofbiz to find various  
>> entities.
>>
>>      <form name="ListRequests" type="list"  
>> extends="ListRequestList" list-name="listIt">
>>        <actions>
>>          <service service-name="performFind" result-map="result"  
>> result-map-list="listIt">
>>            <field-map field-name="inputFields" from-field="parameters"/>
>>            <field-map field-name="entityName" from-field="entityName"/>
>>            <field-map field-name="orderBy"  
>> from-field="parameters.sortField"/>
>>            <field-map field-name="viewIndex" from-field="viewIndex"/>
>>            <field-map field-name="viewSize" from-field="viewSize"/>
>>          </service>
>>        </actions>
>>    </form>
>>
>> On debugging performFind, I found that when I select multiple  
>> status value to perform a find, the multiple status values  
>> translate into the following entity condition
>>
>>                               statusId = '{CRQ_SUBMITTED,  
>> CRQ_ACCEPTED, CRQ_COMPLETED,CRQ_QUOATED}'
>>
>> This will never return matching resultset since the multiple values  
>> are combined against a single condition. Ideally the conditions  
>> should be translated to multiple status values with OR logic, i.e.  
>> statusId= CRQ_SUBMITTED OR statusId=CRQ_ACCEPTED OR  
>> statusId=CRQ_COMPLETED OR statusId=CRQ_QUOATED.
>>
>> Is there anyway I can achieve the above with minimum changes to  
>> performFind service for such scenarios.
>>
>> The reason I am not inclined towards building a separate service  
>> for this behaviour as it would involve a greater impact to the  
>> overall stable functionality of "Find Requests".
>>
>> Would greatly appreciate help on this from the community.
>>
>> Regards
>> GP
>>
>
>
> --
> Nicolas MALIN
> Consultant
> Tél : 06.17.66.40.06
> Site projet : http://www.neogia.org/
> -------
> Société LibrenBerry
> Tél : 02.48.02.56.12
> Site : http://www.librenberry.net/
>
>



gp
Reply | Threaded
Open this post in threaded view
|

Re: PerformFind Requests By Multiple Requests

gp
Hi All,

A related issue that I am facing is, after submission of "Find  
Request" form with a few status checkboxes checked, I am able to see  
the correct dataset being returned in the list, but I am losing all  
the status checkbox state, i.e. all status checkboxes get reset, which  
makes it impossible to access the paginated records in the next page.

When I looked into the server logs, I could see an error, of trying to  
convert a list to a String while setting back the state into the  
checkbox element.

As communicate in my earlier problem, my checkbox declaration in the  
"Find Request" is as given below.

       <field name="statusId">
            <check allow-empty="true">
                <entity-options entity-name="StatusItem"  
description="${description}">
                    <entity-constraint name="statusTypeId"  
operator="equals" value="CUSTREQ_STTS"/>
                    <entity-order-by field-name="sequenceId"/>
                </entity-options>
            </check>
        </field>

Requesting for help, thanks.

Regards
GP


Quoting [hidden email]:

> Awesome!!!
>
> Thank you so much Nicolas, it worked like a charm.
>
> Regards
> GP
>
> Quoting Nicolas Malin <[hidden email]>:
>
>> Hi GP,
>>
>> Can you try the operator in ? as like :
>> <field name="statusId_op"><hidden value="in"/> </field>
>>
>> Nicolas
>>
>> Le 05/03/2013 17:51, [hidden email] a écrit :
>>> Hi,
>>>
>>> I am trying to change the "Find Requests" screen to be able to  
>>> search by multiple status. A part of the change that I did for  
>>> this on the UI is as shown below.
>>>
>>>      <field name="statusId">
>>>           <check allow-empty="true">
>>>               <entity-options entity-name="StatusItem"  
>>> description="${description}">
>>>                   <entity-constraint name="statusTypeId"  
>>> operator="equals" value="CUSTREQ_STTS"/>
>>>                   <entity-order-by field-name="sequenceId"/>
>>>               </entity-options>
>>>           </check>
>>>       </field>
>>>
>>> This renders the status as checkboxes, and with this change I am  
>>> able to select multiple status for performing a search. The  
>>> service linked to the "Find Requests" screen is performFind, which  
>>> as I understand is a generic service used across ofbiz to find  
>>> various entities.
>>>
>>>     <form name="ListRequests" type="list"  
>>> extends="ListRequestList" list-name="listIt">
>>>       <actions>
>>>         <service service-name="performFind" result-map="result"  
>>> result-map-list="listIt">
>>>           <field-map field-name="inputFields" from-field="parameters"/>
>>>           <field-map field-name="entityName" from-field="entityName"/>
>>>           <field-map field-name="orderBy"  
>>> from-field="parameters.sortField"/>
>>>           <field-map field-name="viewIndex" from-field="viewIndex"/>
>>>           <field-map field-name="viewSize" from-field="viewSize"/>
>>>         </service>
>>>       </actions>
>>>   </form>
>>>
>>> On debugging performFind, I found that when I select multiple  
>>> status value to perform a find, the multiple status values  
>>> translate into the following entity condition
>>>
>>>                              statusId = '{CRQ_SUBMITTED,  
>>> CRQ_ACCEPTED, CRQ_COMPLETED,CRQ_QUOATED}'
>>>
>>> This will never return matching resultset since the multiple  
>>> values are combined against a single condition. Ideally the  
>>> conditions should be translated to multiple status values with OR  
>>> logic, i.e. statusId= CRQ_SUBMITTED OR statusId=CRQ_ACCEPTED OR  
>>> statusId=CRQ_COMPLETED OR statusId=CRQ_QUOATED.
>>>
>>> Is there anyway I can achieve the above with minimum changes to  
>>> performFind service for such scenarios.
>>>
>>> The reason I am not inclined towards building a separate service  
>>> for this behaviour as it would involve a greater impact to the  
>>> overall stable functionality of "Find Requests".
>>>
>>> Would greatly appreciate help on this from the community.
>>>
>>> Regards
>>> GP
>>>
>>
>>
>> --
>> Nicolas MALIN
>> Consultant
>> Tél : 06.17.66.40.06
>> Site projet : http://www.neogia.org/
>> -------
>> Société LibrenBerry
>> Tél : 02.48.02.56.12
>> Site : http://www.librenberry.net/
>>
>>
>
>
>
>


gp
Reply | Threaded
Open this post in threaded view
|

Re: PerformFind Requests By Multiple Requests

gp
In reply to this post by gp
Dear All,

Would greatly a appreciate any help/clues on the check box issue as indicated below.

Putting it in simple words, if my check boxes are rendered via entity-options, post form submission the check boxes are losing their values if multiple check boxes were selected at the time of form submission.

The specific  way in which I am rendering the check boxes is given in the mail below.

Regards
GP

[hidden email] wrote:

>Hi All,
>
>A related issue that I am facing is, after submission of "Find  
>Request" form with a few status checkboxes checked, I am able to see  
>the correct dataset being returned in the list, but I am losing all  
>the status checkbox state, i.e. all status checkboxes get reset, which  
>makes it impossible to access the paginated records in the next page.
>
>When I looked into the server logs, I could see an error, of trying to  
>convert a list to a String while setting back the state into the  
>checkbox element.
>
>As communicate in my earlier problem, my checkbox declaration in the  
>"Find Request" is as given below.
>
>       <field name="statusId">
>            <check allow-empty="true">
>                <entity-options entity-name="StatusItem"  
>description="${description}">
>                    <entity-constraint name="statusTypeId"  
>operator="equals" value="CUSTREQ_STTS"/>
>                    <entity-order-by field-name="sequenceId"/>
>                </entity-options>
>            </check>
>        </field>
>
>Requesting for help, thanks.
>
>Regards
>GP
>
>
>Quoting [hidden email]:
>
>> Awesome!!!
>>
>> Thank you so much Nicolas, it worked like a charm.
>>
>> Regards
>> GP
>>
>> Quoting Nicolas Malin <[hidden email]>:
>>
>>> Hi GP,
>>>
>>> Can you try the operator in ? as like :
>>> <field name="statusId_op"><hidden value="in"/> </field>
>>>
>>> Nicolas
>>>
>>> Le 05/03/2013 17:51, [hidden email] a écrit :
>>>> Hi,
>>>>
>>>> I am trying to change the "Find Requests" screen to be able to  
>>>> search by multiple status. A part of the change that I did for  
>>>> this on the UI is as shown below.
>>>>
>>>>      <field name="statusId">
>>>>           <check allow-empty="true">
>>>>               <entity-options entity-name="StatusItem"  
>>>> description="${description}">
>>>>                   <entity-constraint name="statusTypeId"  
>>>> operator="equals" value="CUSTREQ_STTS"/>
>>>>                   <entity-order-by field-name="sequenceId"/>
>>>>               </entity-options>
>>>>           </check>
>>>>       </field>
>>>>
>>>> This renders the status as checkboxes, and with this change I am  
>>>> able to select multiple status for performing a search. The  
>>>> service linked to the "Find Requests" screen is performFind, which  
>>>> as I understand is a generic service used across ofbiz to find  
>>>> various entities.
>>>>
>>>>     <form name="ListRequests" type="list"  
>>>> extends="ListRequestList" list-name="listIt">
>>>>       <actions>
>>>>         <service service-name="performFind" result-map="result"  
>>>> result-map-list="listIt">
>>>>           <field-map field-name="inputFields" from-field="parameters"/>
>>>>           <field-map field-name="entityName" from-field="entityName"/>
>>>>           <field-map field-name="orderBy"  
>>>> from-field="parameters.sortField"/>
>>>>           <field-map field-name="viewIndex" from-field="viewIndex"/>
>>>>           <field-map field-name="viewSize" from-field="viewSize"/>
>>>>         </service>
>>>>       </actions>
>>>>   </form>
>>>>
>>>> On debugging performFind, I found that when I select multiple  
>>>> status value to perform a find, the multiple status values  
>>>> translate into the following entity condition
>>>>
>>>>                              statusId = '{CRQ_SUBMITTED,  
>>>> CRQ_ACCEPTED, CRQ_COMPLETED,CRQ_QUOATED}'
>>>>
>>>> This will never return matching resultset since the multiple  
>>>> values are combined against a single condition. Ideally the  
>>>> conditions should be translated to multiple status values with OR  
>>>> logic, i.e. statusId= CRQ_SUBMITTED OR statusId=CRQ_ACCEPTED OR  
>>>> statusId=CRQ_COMPLETED OR statusId=CRQ_QUOATED.
>>>>
>>>> Is there anyway I can achieve the above with minimum changes to  
>>>> performFind service for such scenarios.
>>>>
>>>> The reason I am not inclined towards building a separate service  
>>>> for this behaviour as it would involve a greater impact to the  
>>>> overall stable functionality of "Find Requests".
>>>>
>>>> Would greatly appreciate help on this from the community.
>>>>
>>>> Regards
>>>> GP
>>>>
>>>
>>>
>>> --
>>> Nicolas MALIN
>>> Consultant
>>> Tél : 06.17.66.40.06
>>> Site projet : http://www.neogia.org/
>>> -------
>>> Société LibrenBerry
>>> Tél : 02.48.02.56.12
>>> Site : http://www.librenberry.net/
>>>
>>>
>>
>>
>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: PerformFind Requests By Multiple Requests

Jacques Le Roux
Administrator
Have a look at https://demo-trunk.ofbiz.apache.org/example/control/FormWidgetExamples#DropDownMultipleFieldExampleForm_multipleDropDownFields_title

Jacques

From: "GP" <[hidden email]>

> Dear All,
>
> Would greatly a appreciate any help/clues on the check box issue as indicated below.
>
> Putting it in simple words, if my check boxes are rendered via entity-options, post form submission the check boxes are losing their values if multiple check boxes were selected at the time of form submission.
>
> The specific  way in which I am rendering the check boxes is given in the mail below.
>
> Regards
> GP
>
> [hidden email] wrote:
>
>>Hi All,
>>
>>A related issue that I am facing is, after submission of "Find  
>>Request" form with a few status checkboxes checked, I am able to see  
>>the correct dataset being returned in the list, but I am losing all  
>>the status checkbox state, i.e. all status checkboxes get reset, which  
>>makes it impossible to access the paginated records in the next page.
>>
>>When I looked into the server logs, I could see an error, of trying to  
>>convert a list to a String while setting back the state into the  
>>checkbox element.
>>
>>As communicate in my earlier problem, my checkbox declaration in the  
>>"Find Request" is as given below.
>>
>>       <field name="statusId">
>>            <check allow-empty="true">
>>                <entity-options entity-name="StatusItem"  
>>description="${description}">
>>                    <entity-constraint name="statusTypeId"  
>>operator="equals" value="CUSTREQ_STTS"/>
>>                    <entity-order-by field-name="sequenceId"/>
>>                </entity-options>
>>            </check>
>>        </field>
>>
>>Requesting for help, thanks.
>>
>>Regards
>>GP
>>
>>
>>Quoting [hidden email]:
>>
>>> Awesome!!!
>>>
>>> Thank you so much Nicolas, it worked like a charm.
>>>
>>> Regards
>>> GP
>>>
>>> Quoting Nicolas Malin <[hidden email]>:
>>>
>>>> Hi GP,
>>>>
>>>> Can you try the operator in ? as like :
>>>> <field name="statusId_op"><hidden value="in"/> </field>
>>>>
>>>> Nicolas
>>>>
>>>> Le 05/03/2013 17:51, [hidden email] a écrit :
>>>>> Hi,
>>>>>
>>>>> I am trying to change the "Find Requests" screen to be able to  
>>>>> search by multiple status. A part of the change that I did for  
>>>>> this on the UI is as shown below.
>>>>>
>>>>>      <field name="statusId">
>>>>>           <check allow-empty="true">
>>>>>               <entity-options entity-name="StatusItem"  
>>>>> description="${description}">
>>>>>                   <entity-constraint name="statusTypeId"  
>>>>> operator="equals" value="CUSTREQ_STTS"/>
>>>>>                   <entity-order-by field-name="sequenceId"/>
>>>>>               </entity-options>
>>>>>           </check>
>>>>>       </field>
>>>>>
>>>>> This renders the status as checkboxes, and with this change I am  
>>>>> able to select multiple status for performing a search. The  
>>>>> service linked to the "Find Requests" screen is performFind, which  
>>>>> as I understand is a generic service used across ofbiz to find  
>>>>> various entities.
>>>>>
>>>>>     <form name="ListRequests" type="list"  
>>>>> extends="ListRequestList" list-name="listIt">
>>>>>       <actions>
>>>>>         <service service-name="performFind" result-map="result"  
>>>>> result-map-list="listIt">
>>>>>           <field-map field-name="inputFields" from-field="parameters"/>
>>>>>           <field-map field-name="entityName" from-field="entityName"/>
>>>>>           <field-map field-name="orderBy"  
>>>>> from-field="parameters.sortField"/>
>>>>>           <field-map field-name="viewIndex" from-field="viewIndex"/>
>>>>>           <field-map field-name="viewSize" from-field="viewSize"/>
>>>>>         </service>
>>>>>       </actions>
>>>>>   </form>
>>>>>
>>>>> On debugging performFind, I found that when I select multiple  
>>>>> status value to perform a find, the multiple status values  
>>>>> translate into the following entity condition
>>>>>
>>>>>                              statusId = '{CRQ_SUBMITTED,  
>>>>> CRQ_ACCEPTED, CRQ_COMPLETED,CRQ_QUOATED}'
>>>>>
>>>>> This will never return matching resultset since the multiple  
>>>>> values are combined against a single condition. Ideally the  
>>>>> conditions should be translated to multiple status values with OR  
>>>>> logic, i.e. statusId= CRQ_SUBMITTED OR statusId=CRQ_ACCEPTED OR  
>>>>> statusId=CRQ_COMPLETED OR statusId=CRQ_QUOATED.
>>>>>
>>>>> Is there anyway I can achieve the above with minimum changes to  
>>>>> performFind service for such scenarios.
>>>>>
>>>>> The reason I am not inclined towards building a separate service  
>>>>> for this behaviour as it would involve a greater impact to the  
>>>>> overall stable functionality of "Find Requests".
>>>>>
>>>>> Would greatly appreciate help on this from the community.
>>>>>
>>>>> Regards
>>>>> GP
>>>>>
>>>>
>>>>
>>>> --
>>>> Nicolas MALIN
>>>> Consultant
>>>> Tél : 06.17.66.40.06
>>>> Site projet : http://www.neogia.org/
>>>> -------
>>>> Société LibrenBerry
>>>> Tél : 02.48.02.56.12
>>>> Site : http://www.librenberry.net/
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>