Table of Contents Previous Section
WOConditional
Synopsis
WOConditional { condition=YES|NO; [negate=YES|NO;] ... };
Description
A WOConditional object controls whether a portion of the HTML page will be generated, based on the evaluation of its assigned condition.
- condition
- Expression to evaluate. If the expression evaluates to YES (assuming negate is NO), the HTML code controlled by the WOConditional object is emitted; otherwise it is not.
- negate
- Inverts the sense of the condition. By default, negate is assumed to be NO.
The negate attribute lets you use the same test to display mutually exclusive information; for example:
HTML file
<HTML>
<WEBOBJECTS NAME="PAYING_CUSTOMER">Thank you for your order!</WEBOBJECTS>
<WEBOBJECTS NAME="WINDOW_SHOPPER">Thanks for visiting!</WEBOBJECTS>
</HTML>
Declarations File
PAYING_CUSTOMER: WOConditional {condition=payingCustomer;};
WINDOW_SHOPPER: WOConditional {condition=payingCustomer; negate=YES;};
Script File
- payingCustomer {
if (/* ordered something */) {
return YES;
}
return NO;
}
Examples
Conditional display
Table of Contents Next Section