You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Randy Leonard <oc...@mac.com> on 2007/03/05 06:12:43 UTC
Re: [jira] Commented: (TAPESTRY-1276) IF component should include an optional 'negate' parameter
> such as extending the property expression syntax to support an
inversion operator
Agreed... I suspect this would have uses beyond the IF component.
On Feb 22, 2007, at 12:14 PM, Howard M. Lewis Ship (JIRA) wrote:
>
> [ https://issues.apache.org/jira/browse/TAPESTRY-1276?
> page=com.atlassian.jira.plugin.system.issuetabpanels:comment-
> tabpanel#action_12475122 ]
>
> Howard M. Lewis Ship commented on TAPESTRY-1276:
> ------------------------------------------------
>
> It's more verbose for some things, but I quite often find I need
> two ifs: for the normal case, and one for the else case. This
> merges both cases together with a minimum of fuss.
>
> I'm not saying the negate parameter is bad (T4 has an equivalent
> "invert" parameter), but there may be other options that are
> better, such as extending the property expression syntax to support
> an inversion operator, i.e.
>
> <t:comp type="if" test="! order.lineItems">
> . . .
> </t:comp>
>
> Another option would be to create an Unless component:
>
> <t:comp type="unless" test="order.lineItems">
> . . .
> </t:comp>
>
> I find both of these preferable to a negate or invert parameter.
>
>> IF component should include an optional 'negate' parameter
>> ----------------------------------------------------------
>>
>> Key: TAPESTRY-1276
>> URL: https://issues.apache.org/jira/browse/
>> TAPESTRY-1276
>> Project: Tapestry
>> Issue Type: New Feature
>> Components: Core
>> Affects Versions: 5.0
>> Environment: MacOS X 10.4.8, Eclipse 3.2.1
>> Reporter: Randy Leonard
>> Priority: Minor
>> Fix For: 5.0
>>
>>
>> It would be useful for the 'If' component to take an optional
>> 'negate' parameter, much like the WOCondition component in
>> WebObjects. This would allow the component content to be rendered
>> if the associated condition is FALSE instead of TRUE, therefore
>> eliminating the need to write an additional Java method to perform
>> this negate operation.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org