You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Jacek Wagner <ja...@berkeley.edu> on 2009/02/23 19:53:13 UTC

Screen-Widget enforce non-empty fields

All,

Is there an easy way to enforce a non-empty fields in the screen-widget 
form without using a complex service like createCustomer

When it comes to drop-down you can allow-empty to false or true. What 
about other fields?

Jacek

expending OrderLookupServices

Posted by Jacek Wagner <ja...@berkeley.edu>.
All,

I am expending findOrders (OrderLookupServices)  by adding  
OrderAttribute and Payment as searchable entities.

The OrderAttribute works as expected
        // search by child name
        if (UtilValidate.isNotEmpty(childName)) {
            dve.addMemberEntity("OA", "OrderAttribute");
            dve.addAlias("OA", "attrValue");
            dve.addViewLink("OH", "OA", Boolean.FALSE, 
UtilMisc.toList(new ModelKeyMap("orderId", "orderId")));
            paramList.add("attrValue=" + childName);
            conditions.add(makeExpr("attrValue", childName));
        }

but

        // search by payment ref number
        if (UtilValidate.isNotEmpty(paymentRefNum)) {
            dve.addMemberEntity("PT", "Payment");
            dve.addAlias("PT", "paymentRefNum");
            dve.addViewLink("OP", "PT", Boolean.FALSE, 
UtilMisc.toList(new ModelKeyMap("orderPaymentPreferenceId", 
"paymentPreferenceId")));
            paramList.add("paymentRefNum=" + paymentRefNum);
            conditions.add(makeExpr("paymentRefNum", paymentRefNum));
        }
 returns message ..orderPaymentPreferenceId does not exist on the 
Payment entity.

Note: this is the case  where  matching fields have  different  names.

I did not find any example in ofbiz that can help me to resolve this issue.

Jacek