You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by phillip rhodes <rh...@yahoo.com> on 2004/10/05 22:15:38 UTC

Conditional component test for null object with ognl?

I have a get methods that returns a property that is
sometimes null.
Is there a way to test for this with ognl and the
Conditional component?

I am trying to avoid writing a LOT of extra boolean
"isNull" methods

Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Conditional component test for null object with ognl?

Posted by Jamie Orchard-Hays <ja...@dang.com>.
and ognl will even translate a null value to false.

<component id="isTrue" type="Conditional">
    <binding condition="condition" expression="myProperty"/>
</component>

If myProperty is null, this will return false.

also, here's a link to the ognl Users Guide:
http://www.ognl.org/2.6.3/Documentation/html/UsersGuide.html


Jamie

----- Original Message ----- 
From: "Danny Mandel" <dm...@tolweb.org>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, October 05, 2004 4:17 PM
Subject: Re: Conditional component test for null object with ognl?


> Yeah, like this:
> 
> <span jwcid="@Conditional" condition="ognl:property != null">
> </span>
> 
> Hope that helps,
> Danny
> 
> phillip rhodes wrote:
> 
> >I have a get methods that returns a property that is
> >sometimes null.
> >Is there a way to test for this with ognl and the
> >Conditional component?
> >
> >I am trying to avoid writing a LOT of extra boolean
> >"isNull" methods
> >
> >Thanks.
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >  
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Conditional component test for null object with ognl?

Posted by Danny Mandel <dm...@tolweb.org>.
Yeah, like this:

<span jwcid="@Conditional" condition="ognl:property != null">
</span>

Hope that helps,
Danny

phillip rhodes wrote:

>I have a get methods that returns a property that is
>sometimes null.
>Is there a way to test for this with ognl and the
>Conditional component?
>
>I am trying to avoid writing a LOT of extra boolean
>"isNull" methods
>
>Thanks.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org