Dev - how to set entity-constraint for null values in form def?

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

Dev - how to set entity-constraint for null values in form def?

Jacopo Cappellato
Hi all,

in form widget, is there a way to select records

I need to define the following selection for a drop-down field in a form
widget:

"select * from CostComponentType where parentTypeId is null"

This is what I've tried to do:

<field name="costComponentTypeId">
  <drop-down allow-empty="false">
   <entity-options entity-name="CostComponentType"
description="${description}">
    <entity-constraint name="parentTypeId" operator="equals" value=""/>
   </entity-options>
  </drop-down>
</field>

Unfortunately this doesn't seem to work (the constraint is ignored)...
can you help me?

Thanks,

Jacopo
 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Dev - how to set entity-constraint for null values in formdef ?

Oleg Kozyrev Jr.
Jacopo,

Just an idea (don't know whether it'll help). Try ignore-if-empty, ignore-if-null attributes of <entity-constraint>.
As for me, I usually work with <list-options>, selecting data in .bsh. You can try this way.

Oleg.


-----Original Message-----
From: Jacopo Cappellato <[hidden email]>
To: "OFBiz Project Development Discussion (High Traffic)" <[hidden email]>
Date: Tue, 18 Apr 2006 12:35:29 +0200
Subject: [OFBiz] Dev - how to set entity-constraint for null values in formdef?

>
> Hi all,
>
> in form widget, is there a way to select records
>
> I need to define the following selection for a drop-down field in a form
> widget:
>
> "select * from CostComponentType where parentTypeId is null"
>
> This is what I've tried to do:
>
> <field name="costComponentTypeId">
>   <drop-down allow-empty="false">
>    <entity-options entity-name="CostComponentType"
> description="${description}">
>     <entity-constraint name="parentTypeId" operator="equals" value=""/>
>    </entity-options>
>   </drop-down>
> </field>
>
> Unfortunately this doesn't seem to work (the constraint is ignored)...
> can you help me?
>
> Thanks,
>
> Jacopo
>  
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/dev
>


Как познакомиться с десятками людей за один день? Мы знаем один простой способ http://r.mail.ru/cln2844/agent.mail.ru/talk.html
 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Dev - how to set entity-constraint for null values in form def?

David E. Jones
In reply to this post by Jacopo Cappellato

This is fairly trivial actually. Just use the "null" variable that is sitting in the environment rather than a value which ends up as an empty String. In other works instead of value="" use env-name="null".

-David


Jacopo Cappellato wrote:

> Hi all,
>
> in form widget, is there a way to select records
>
> I need to define the following selection for a drop-down field in a form
> widget:
>
> "select * from CostComponentType where parentTypeId is null"
>
> This is what I've tried to do:
>
> <field name="costComponentTypeId">
>   <drop-down allow-empty="false">
>    <entity-options entity-name="CostComponentType"
> description="${description}">
>     <entity-constraint name="parentTypeId" operator="equals" value=""/>
>    </entity-options>
>   </drop-down>
> </field>
>
> Unfortunately this doesn't seem to work (the constraint is ignored)...
> can you help me?
>
> Thanks,
>
> Jacopo
>  
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/dev
 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Dev - how to set entity-constraint for null values in form def?

Jacopo Cappellato
Thanks!!!

Jacopo

David E. Jones wrote:

> This is fairly trivial actually. Just use the "null" variable that is sitting in the environment rather than a value which ends up as an empty String. In other works instead of value="" use env-name="null".
>
> -David
>
>
> Jacopo Cappellato wrote:
>> Hi all,
>>
>> in form widget, is there a way to select records
>>
>> I need to define the following selection for a drop-down field in a form
>> widget:
>>
>> "select * from CostComponentType where parentTypeId is null"
>>
>> This is what I've tried to do:
>>
>> <field name="costComponentTypeId">
>>   <drop-down allow-empty="false">
>>    <entity-options entity-name="CostComponentType"
>> description="${description}">
>>     <entity-constraint name="parentTypeId" operator="equals" value=""/>
>>    </entity-options>
>>   </drop-down>
>> </field>
>>
>> Unfortunately this doesn't seem to work (the constraint is ignored)...
>> can you help me?
>>
>> Thanks,
>>
>> Jacopo
>>  
>> _______________________________________________
>> Dev mailing list
>> [hidden email]
>> http://lists.ofbiz.org/mailman/listinfo/dev
>  
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/dev
>

 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev