BBJSP Widget (Deprecated)

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


 

Description

All user widgets for use in BBJSP pages need to implement this interface.

Methods of BBjspWidget

Return Value

Method

void

open(BBjspPageContextcontext)

Remarks

None.

Example

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

This example demonstrates how this works in a BBJSP web-page

<%@ taglib uri='/WEB-CFG/tld/core.tld' prefix='c' %>
<bbj:widget id='myWidget' source='widgets/SimpleWidget.bbj' class='SimpleWidget' />
<html>
  <body>
    <h1>Hello from BBJSP</h1>
    <ul>
      <c:iterate data='${myWidget["MyVector"]}' id="name">
        <li><b>${name}</b>
      </c:iterate>
    </ul>
    ${myWidget["Test"]}
  </body>
</html>

See Also

BBJSP

BBjspPageContext

BBJSP Widget Overview