On 05/18/2012 03:13 AM, Deepak Dixit wrote:
> Hello Adam,
>
> We can't pass *null* from ftl if we have to pass null then we can use *NULL*
> like:
>
> <#assign productStroe =
> delegator.findList("ProductStore",NULL,NULL,NULL,NULL, false) />
>
> Passing *null* is prohibited in NodeListModel class
> (http://www.docjar.org/docs/api/freemarker/ext/xml/NodeListModel.html).
>
> To create an empty model, pass it an empty collection. If we pass an empty
> list in new findByAnd method then it should work fine:
>
> <#assign shipmentReceipts = delegator.findByAnd("ShipmentReceipt",
> {"orderId": orderHeader.getString("orderId"), "orderItemSeqId":
> orderItem.orderItemSeqId}, [], false)/>
I thought of this, and rejected it. It will cause more memory churn
than is really nescessary. All the dummy empty objects. The same
goes for Static['Collections'].EMPTY_MAP, as that has too much runtime
method invocation overhead.
Altho, maybe if ofbiz auto-inserted EMPTY_MAP and EMPTY_LIST, but even
that would require a context variable lookup, for what really should
be a *real* constant value.
And, I do not want to *have* to modify *every* *single* *ftl* line
again that calls the new findByAnd.