Fan

 

abstract class

webapp::Widget

sys::Obj
  web::Weblet
    webapp::Widget

@serializable

Widget is the base class for all web-based UI widgets.

See docLib::WebWidget

Slots

bodySource

WebOutStream body()

The buffered WebOutStream for the <body> element.

callSource

Uri call(Method m, Uri uri := this.req.uri())

Return a Uri that can be used to call a specific method on a Widget, bypassing the normal service implementation.

finishResSource

virtual Void finishRes()

Finish the response. For HTML pages, this method is responsible for writing the ending <head> and <body> tags in the respective buffers.

WebOutStream head()

The buffered WebOutStream for the <head> element.

minusCallSource

Uri minusCall(Uri uri)

Return a new Uri that removes the Widget.call specifics from the given Uri.

onCallSource

virtual Void onCall(Method m)

Handle invoking a method requested using a Uri from Widget.call.

serviceSource

override Void service()

Handle configuring the inital Widget pipeline. To allow Widgets to be nested, we use two thread local Bufs to capture the output for the <head> and <body> tags separately. After the request has been serviced, we flush the Bufs to the actual output stream.

If this method is called again (on any instance) after the initial call, it short-circuits and simply calls the default web::Weblet.service implementation.

startResSource

virtual Void startRes()

Start the response. For HTML pages, this method is responsible for creating the markup up to and including the starting <head> and <body> tags in their respective buffers.

uniqueSource

Str unique()

Return a name that is unique to this web request. The name returned can be used as a valid HTML name or id attribute, as well as a JavaScript variable name.