BBjspPageContext::setAttribute (Deprecated)

The BBJSP system is deprecated. For new development, use BBxServlet.

Description

In BBj 16.0 and higher, this method binds an object to the specified name within the attributes of the specified scope.

Syntax

Return Value

Method

void

setAttribute(string name, Object object)

void

setAttribute(string name, Object object, int scope)

Parameters

Variable

Description

name

the name of the attribute

object

the object of be bound

scope

the scope in which to set this attribute

Return Value

None.

Remarks

Example

This example demonstrates how this works in a BBJSP widget

REM ===
REM === A simple BBjspWidget that puts a BBjVector in the BBjspPageContext.
REM ===

class public SimpleWidget implements BBjspWidget

    field public BBjVector MyVector!
    field public BBjString Test$="Test Widget"

    method public void open(BBjspPageContext context!)
        #MyVector!=BBjAPI().makeVector()
        #MyVector!.add("Hello World")
        #MyVector!.add("This in a Vector")
    methodend

classend

See Also

BBJSP

BBjspPageContext