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 [email protected]:
Awesome!!!
Thank you so much Nicolas, it worked like a charm.
Regards
GP
Quoting Nicolas Malin <[email protected]>:
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, [email protected] 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/