Logic Tags
Tag boolexpr


This tag evaluates a boolean expression and stores the result as a boolean in memory. It is designed to work with the logic.if tag.

Example:
<pt:logic.collectionlength pt:data="testcollection" pt:key="length"/>
<pt:logic.intexpr pt:expr="($length) > 5" pt:key="greater5"/>
<pt:logic.intexpr pt:expr="($length) < 10" pt:key="less10"/>
<pt:logic.boolexpr pt:expr="($greater5) && ($less10)" pt:key="boolvalue"/>
<pt:logic.if pt:expr="$boolvalue">
 <pt:logic.iftrue>
  This is displayed if expr evaluates to true.
 </pt:logic.iftrue>
 <pt:logic.iffalse>
   This is displayed if expr evaluates to false.
 </pt:logic.iffalse>
</pt:logic.if>


Tag Information
Tag Nameboolexpr

Attributes
NameTypeRequiredDefault ValueDescription
exprstringtruenullA boolean value or a tag variable, followed by a boolean comparator, and then another boolean value or tag variable. Spaces can be added around the comparator for legibility if desired. The tag variables must evaluate to an boolean and be in $ attribute notation surrounded by parentheses. The following operators are allowed: '&&', '||', '==', and '!='.
keystringtruenullThe key used to store the result in memory.
scopestringfalseportlet requestThe scope used to store the result in memory. See the Logic tag library description for details about valid scope arguments.


Copyright 2005 Plumtree Software, Inc.