Bean Scripting Scopes
A bean has its own scripting scope, similar to a report's scope, and all elements within the bean fall within the bean's scope. Therefore, if you place a script on an element within a bean, when the script encounters a symbol (variable, property), the server checks for the reference in the following sequence:
1. Search element scope (i.e., properties defined by the element to which the script is attached).
2. Search the bean “report” scope (i.e., properties defined by the onInit Handler and onLoad Handler of the bean containing the element).
3. Search the bean “element” scope (i.e., properties defined by element-level script attached to the bean element within the parent report).
4. Search parent report scope.
5. Search global scope.
Accessing Report Elements of Same Name
Because the server searches bean scope first, variables and elements in the bean will hide objects of the same name in the containing report. To access such objects in the containing report, use the ParentReport Object. For example, if the bean contains a text element with Element ID of 'Title', and the parent report also contains a text element with Element ID of 'Title', you can access the parent report instance as follows:
parentReport.Title
or
parentReport['Title']