You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Brian Long <bl...@annadaletech.com> on 2009/10/05 17:39:15 UTC

Property expressions

Hi all,

just a quick question, looking at the property expressions guide @
http://tapestry.apache.org/tapestry5/guide/propexp.html it looks like I
should be able to evaluate whether a property has a null value (handy
for if conditions) without having to use ognl,

e.g. instead of

        <t:if test="ognl:(payoutTransfers != null)">
                <t:actionlink
t:id="exportButton">${message:EXPORT}</t:actionlink>
        </t:if>

I should be able to use the property expression directly, there's a null
keyword and an notOpt !, but what is the proper synthax?

Regards, Brian.

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


Re: Property expressions

Posted by Brian Long <bl...@annadaletech.com>.
Thanks for the quick replay, my updated 'ognless' if condition now reads
. . .

            <t:if test="payoutTransfers">
                <t:actionlink
t:id="exportButton">${message:EXPORT}</t:actionlink>
            </t:if>

/Brian. :-)

Howard Lewis Ship wrote:
> The not operator (!) coerces the value to a boolean; nil is false, as
> is any kind of empty collection.  Thus
> <t:if test="! payoutTransfers"> ... </t:if> should work.
>
> On Mon, Oct 5, 2009 at 8:39 AM, Brian Long <bl...@annadaletech.com> wrote:
>   
>> Hi all,
>>
>> just a quick question, looking at the property expressions guide @
>> http://tapestry.apache.org/tapestry5/guide/propexp.html it looks like I
>> should be able to evaluate whether a property has a null value (handy
>> for if conditions) without having to use ognl,
>>
>> e.g. instead of
>>
>>        <t:if test="ognl:(payoutTransfers != null)">
>>                <t:actionlink
>> t:id="exportButton">${message:EXPORT}</t:actionlink>
>>        </t:if>
>>
>> I should be able to use the property expression directly, there's a null
>> keyword and an notOpt !, but what is the proper synthax?
>>
>> Regards, Brian.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
>
>
>   


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


Re: Property expressions

Posted by Howard Lewis Ship <hl...@gmail.com>.
The not operator (!) coerces the value to a boolean; nil is false, as
is any kind of empty collection.  Thus
<t:if test="! payoutTransfers"> ... </t:if> should work.

On Mon, Oct 5, 2009 at 8:39 AM, Brian Long <bl...@annadaletech.com> wrote:
> Hi all,
>
> just a quick question, looking at the property expressions guide @
> http://tapestry.apache.org/tapestry5/guide/propexp.html it looks like I
> should be able to evaluate whether a property has a null value (handy
> for if conditions) without having to use ognl,
>
> e.g. instead of
>
>        <t:if test="ognl:(payoutTransfers != null)">
>                <t:actionlink
> t:id="exportButton">${message:EXPORT}</t:actionlink>
>        </t:if>
>
> I should be able to use the property expression directly, there's a null
> keyword and an notOpt !, but what is the proper synthax?
>
> Regards, Brian.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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