Table of Contents Previous Section

3. Declare and initialize variables for bound keys

In the implementation file or ".wos" script of the server-side component, declare transaction variables for each of the key bindings made in the ".wod" file. Then you can initialize these variables in the init or awake methods. These initialized values are downloaded to the applets when the page is composed.

    id inputString;
    id outputString;
    id functionItemList;
    id functionSelectedItem;

    - init {
        self = [super init];
    
        // Set up parameter values
        inputString = @"Scrumptious";
        outputString = @"";
        functionItemList = [NSArray arrayWithObjects:@"Uppercase", 
            @"Lowercase", @"Capitalize", @"Flandersize", nil];
        functionSelectedItem = @"0";
    
        return self;
    }

In this example, the initial values of both TextFieldApplets are set as well the items of the ListApplet. Setting the functionSelectedItem to zero causes the first item in the functionItemList array ("Uppercase") to be preselected.

Table of Contents Next Section