Creating a Rich UI application with multiple handlers

You can use multiple Rich UI handler parts to compose a single application. However, you cannot embed one handler part in another. Instead, the handler part declares variables that are each based on another handler part. A variable that is based on an Rich UI handler part is called an embedded handler:
embeddedHandler AnotherHandlerPart{};  // declared Rich UI handler 
                                          (based on part AnotherHandlerPart)

The embedding Rich UI handler can access the global widgets and public functions that are declared in an embedded Rich UI handler. The embedding handler can add widgets to its own initialUI and children arrays. Also, you can embed a handler that invokes services or otherwise handles business processing. Use one handler to present the user interface and other handlers to oversee the business processing.

You can access widgets and functions with a dot syntax. In the following outline, the AnotherHandlerPart Handler part is assumed to have declared a button named itsButton, which is attached to the DOM tree only when that button is included in the initialUI array of the embedding handler:
handler SimpleHandler type RUIHandler { initialUI = [ embeddedHandler.itsButton ] }
   embeddedHandler AnotherHandlerPart{};
end

In a similar way, you can add an embedded widget to a children array.

You can access a function or property in an embedded widget by extending the a dot syntax. For example, the following statement retrieves the displayed text of the embedded itsButton button:
   myString STRING = embeddedHandler.itsButton.text;

At run time, the initialUI array of the embedded handler has no effect. That array is used only when the embedded handler is the basis of a Rich UI application; the array is not embedded.


Feedback