
Public Member Functions | |
| void | appendToResponse (WOResponse woresponse, WOContext wocontext) |
| ERXWOSwitch (String name, NSDictionary associations, WOElement template) | |
| WOActionResults | invokeAction (WORequest worequest, WOContext wocontext) |
| void | takeValuesFromRequest (WORequest worequest, WOContext wocontext) |
Protected Member Functions | |
| WOElement | childCaseInContext (WOContext context) |
Private Attributes | |
| WOAssociation | _case |
| NSDictionary | _childCases |
==========================
Example.wo/Example.html (modern syntax)
==========================
<wo:ERXWOSwitch case="$case">
<wo:ERXWOCase case="caseOne">
Case One!
</wo:ERXWOCase>
<wo:ERXWOCase case="caseTwo">
Case Two!
</wo:ERXWOCase>
<wo:ERXWOCase case="default">
OTHER
</wo:ERXWOCase>
</wo:ERXWOSwitch>
==========================
Example.wo/Example.html (traditional syntax, with wod below)
==========================
<webobject name=Switch>
<webobject name=CaseOne>
<h2>One: <webobject name=ChosenCaseString></webobject></h2>
</webobject>
<webobject name=CaseTwo>
<h2>Two: <webobject name=ChosenCaseString></webobject></h2>
</webobject>
<webobject name=CaseThree>
<h2>Three: <webobject name=ChosenCaseString></webobject></h2>
</webobject>
<webobject name=CaseFour>
<h2>Four: <webobject name=ChosenCaseString></webobject></h2>
</webobject>
<webobject name=DefaultCase>
<h2>Default: <webobject name=ChosenCaseString></webobject></h2>
</webobject>
</webobject>
==========================
Example.wo/Example.wod
==========================
Switch: ERXWOSwitch {
case = chosenCase;
}
CaseFour: ERXWOCase {
case = "Fourth";
}
CaseOne: ERXWOCase {
case = "First";
}
CaseThree: ERXWOCase {
case = "Third";
}
CaseTwo: ERXWOCase {
case = 2;
}
DefaultCase: ERXWOCase {
case = "default";
}
ChosenCaseString: WOString {
value = chosenCase;
}
==========================
Example.java
==========================
public Object chosenCase() {
Object objects = new Object[] {"Fourth", "Third", "First", new Integer(2), "dummy"};
return objects[(new Random()).nextInt(objects.length)];
}
| ERXWOSwitch | ( | String | name, | |
| NSDictionary | associations, | |||
| WOElement | template | |||
| ) |
| void appendToResponse | ( | WOResponse | woresponse, | |
| WOContext | wocontext | |||
| ) |
| WOElement childCaseInContext | ( | WOContext | context | ) | [protected] |
| WOActionResults invokeAction | ( | WORequest | worequest, | |
| WOContext | wocontext | |||
| ) |
| void takeValuesFromRequest | ( | WORequest | worequest, | |
| WOContext | wocontext | |||
| ) |
WOAssociation _case [private] |
NSDictionary _childCases [private] |
1.5.8