Dynamic elements

The elements that come with the framework, and the bindings each one takes. This page is generated from ng itself: the elements its taglib declares, each documented by the .apiext file beside its class.

<wo:actionURL />

ng.appserver.templating.elements.NGActionURL

Renders the URL that invokes action on this component — for building your own links, forms or scripts around a component action. Tag name: actionURL.

BindingTypeDescription
action required NGActionResultsread

The component action the rendered URL invokes. Pulled at invoke time; required.

<wo:aof>

Container
ng.appserver.templating.elements.ajax.AjaxObserveField

Watches form fields for changes and, after debounce milliseconds of quiet, submits the changed field (or the whole form, with fullSubmit) over Ajax, invoking action and refreshing updateContainerID. Two modes: bind observeFieldID to watch one field (renders an invisible marker; content is ignored), or leave it unbound to wrap the tag's content in a container whose input/textarea/select descendants are all observed. Tag name: aof.

BindingTypeDescription
observeFieldID Stringread

The HTML id of a single field to observe. When unbound the element runs in container mode and observes every field in its content. Pulled.

updateContainerID Stringread

The id of the AjaxUpdateContainer to refresh after the action (several may be given, separated by ;). Pulled.

action NGActionResultsread

The component action invoked when an observed field changes. Pulled at invoke time.

fullSubmit Booleanread

When true (a Boolean), all fields of the containing form are submitted, not just the one that changed. Pulled.

Default: false

debounce Integerread

Milliseconds to wait after the last change before submitting; 0 fires on every change. Pulled; defaults to 300.

Default: 300

elementName Stringread

Container mode: the HTML element rendered around the content. Pulled; defaults to div.

Default: div

id Stringread

Container mode: the HTML id of the wrapper. Pulled; auto-generated from the element ID when unbound.

class Stringread

Container mode: the CSS class of the wrapper. Pulled.

style Stringread

Container mode: the inline style of the wrapper. Pulled.

<wo:asb>

Container
ng.appserver.templating.elements.ajax.AjaxSubmitButton

Submits the enclosing form over Ajax, invoking action and refreshing the AjaxUpdateContainer named by updateContainerID. Renders as an <input type="button">, or — when the tag has content — as a <button> wrapping it. Other bindings are rendered as attributes. Tag name: asb.

BindingTypeDescription
action required NGActionResultsread

The component action invoked when the button is pressed. Pulled at invoke time; required (a button without one fails when pressed).

updateContainerID Stringread

The id of the AjaxUpdateContainer to refresh with the action's result. Pulled.

<wo:auc>

Container
ng.appserver.templating.elements.ajax.AjaxUpdateContainer

Wraps its content in an element (a <div> by default) with the given id, so that AjaxUpdateLink, AjaxSubmitButton and AjaxObserveField can refresh just that part of the page. Other bindings are rendered as attributes. Tag name: auc.

BindingTypeDescription
id required Stringread

The HTML id of the container — what the Ajax elements name in updateContainerID. Pulled; required.

elementName Stringread

The HTML element to render as the container. Pulled; defaults to div.

Default: div

<wo:browser />

ng.appserver.templating.elements.NGBrowser

The multi-selection variant of NGPopUpButton — today an alias for it: the same element, the same bindings. To actually get a multi-select, bind multiple truthy and selections (the default is still single-select via selection). Tag name: browser.

BindingTypeDescription
list required List | SequencedCollectionread

The options: a java.util.List, a Java array, or any SequencedCollection. Pulled; required. Each option's value is its index in this list, so the list must be the same when the form is submitted as when it was rendered — a changed list fails the request.

item → Objectwritten

Pushed each option's object while rendering, so displayString can refer to it.

index → Integerwritten

Pushed each option's zero-based index while rendering.

displayString Objectread

The text shown for the current item. Pulled per option; when unbound the item's toString() is used.

selection Object → Objectread and written

Single-select: the selected object. Pulled to mark the selected option (the sole authority when bound); pushed on submit with the chosen item, or null when the noSelectionString option was chosen.

noSelectionString Stringread

When bound, an extra first option with this label meaning "nothing selected"; choosing it pushes null to selection. Pulled.

multiple Objectread

When truthy the element renders as a multi-select and works with selections instead of selection. Pulled.

selections List → Listread and written

Multi-select: the selected objects. Pulled to mark selected options; pushed on submit as a new List of the chosen items. Required when multiple is truthy.

name Stringread

The HTML form-field name. Pulled; auto-assigned from the element ID when unbound — bind it only when other code needs to know the field name.

disabled Objectread

When truthy the field renders with the disabled attribute and its submitted value is ignored (nothing is pushed).

<wo:checkbox />

ng.appserver.templating.elements.NGCheckbox

An <input type="checkbox"> bound two ways to checked: rendered checked when it is truthy, and on submit pushed true if the box was ticked, false otherwise (a checkbox that isn't ticked is simply absent from the form data). Other bindings are rendered as attributes. Tag name: checkbox.

BindingTypeDescription
checked required Object → Booleanread and written

The checked state. Pulled by truthiness to render; pushed as a Boolean on submit. Required.

name Stringread

The HTML form-field name. Pulled; auto-assigned from the element ID when unbound — bind it only when other code needs to know the field name.

disabled Objectread

When truthy the field renders with the disabled attribute and its submitted value is ignored (nothing is pushed).

<wo:container>

Container
ng.appserver.templating.elements.NGGenericContainer

Renders its content inside an arbitrary HTML element named by elementName. Other bindings become attributes (a null value omits the attribute). Bind omitTags truthy to render only the content. Tag name: container.

BindingTypeDescription
elementName required Stringread

The HTML element name to render, e.g. div. Pulled; required.

omitTags Objectread

When truthy, only the content is rendered — no opening or closing tag. Pulled.

<wo:content />

ng.appserver.templating.elements.NGComponentContent

The place in a wrapper component's template where the content the parent template wrapped in the component tag is rendered (and takes values / invokes actions), in the parent's context. Has no bindings. Tag name: content.

<wo:element />

ng.appserver.templating.elements.NGGenericElement

Renders an arbitrary self-closing HTML element named by elementName. Other bindings become attributes (a null value omits the attribute). Tag name: element.

BindingTypeDescription
elementName required Stringread

The HTML element name to render, e.g. hr or input. Pulled; required.

<wo:fileUpload />

ng.appserver.templating.elements.NGFileUpload

An <input type="file">. On submit, the uploaded file's name and bytes are pushed into filename and data. Tag name: fileUpload.

BindingTypeDescription
filename → Stringwritten

Receives the uploaded file's name. Push only.

data → byte[]written

Receives the uploaded file's bytes. Push only.

name Stringread

The HTML form-field name. Pulled; auto-assigned from the element ID when unbound — bind it only when other code needs to know the field name.

<wo:form>

Container
ng.appserver.templating.elements.NGForm

An HTML <form> for component actions. The form always posts back to the component; action is invoked when the form itself is the submitting element and no submit button claimed the submission. Bindings other than the ones below are rendered as attributes on the <form> tag.

BindingTypeDescription
action NGActionResultsread

The component action invoked when the form is submitted without a specific NGSubmitButton being pressed (or with a button that has no action of its own). Pulled at invoke time; its NGActionResults becomes the response.

method Stringread

The HTTP method rendered on the form. Pulled; defaults to POST.

Default: POST

<wo:if>

Container
ng.appserver.templating.elements.NGConditional

Renders its content only when condition is truthy — and, in the same way, only lets the content take form values and invoke actions when it is. Bind negate to flip the test. Tag name: if.

BindingTypeDescription
condition required Objectread

The value to test, by truthiness (null, false, 0, empty string/collection are false). Pulled; required.

negate Objectread

When truthy, inverts condition: the content renders when the condition is false. Pulled.

<wo:img />

ng.appserver.templating.elements.NGImage

An <img> whose source is a webserver resource (filename), a plain URL (src), or bytes served through the dynamic-resource cache (data / dataInputStream, which require mimeType). Bind exactly one source. Other bindings are rendered as attributes. Tag name: img.

BindingTypeDescription
filename Stringread

The name of a webserver resource in namespace, resolved to its URL. Renders ERROR_NOT_FOUND_<filename> when the resource doesn't exist. Pulled.

namespace Stringread

The resource namespace to look filename up in. Pulled; when unbound, the namespace of the component rendering the element is used.

framework Stringread

Legacy name for namespace.

Deprecated.

Use namespace instead — framework is the legacy name, still honoured (with a logged warning).

src Stringread

A URL rendered verbatim into the src attribute. Pulled.

data byte[]read

Image bytes, cached as a one-off dynamic resource and served by URL. Pulled; requires mimeType.

dataInputStream InputStreamread

A stream of image bytes, cached as a one-off dynamic resource. Pulled; requires mimeType and dataInputStreamLength.

dataInputStreamLength Longread

The number of bytes dataInputStream will deliver (a Long). Pulled.

mimeType Stringread

The MIME type of the bytes given via data/dataInputStream. Pulled.

<wo:password />

ng.appserver.templating.elements.NGPasswordField

An <input type="password">. The submitted text is pushed into value (null when empty); the current value is never rendered back to the browser. Other bindings are rendered as attributes. Tag name: password.

BindingTypeDescription
value required → Stringwritten

Receives the submitted password as a String (null for an empty field). Push only — never rendered. Required.

name Stringread

The HTML form-field name. Pulled; auto-assigned from the element ID when unbound — bind it only when other code needs to know the field name.

disabled Objectread

When truthy the field renders with the disabled attribute and its submitted value is ignored (nothing is pushed).

<wo:popUpButton />

ng.appserver.templating.elements.NGPopUpButton

A <select> over the objects in list. Single-select by default, bound to selection; bind multiple truthy and selections for a multi-select. Options are identified by their index in list. Other bindings are rendered as attributes on the <select>. Tag name: popUpButton.

BindingTypeDescription
list required List | SequencedCollectionread

The options: a java.util.List, a Java array, or any SequencedCollection. Pulled; required. Each option's value is its index in this list, so the list must be the same when the form is submitted as when it was rendered — a changed list fails the request.

item → Objectwritten

Pushed each option's object while rendering, so displayString can refer to it.

index → Integerwritten

Pushed each option's zero-based index while rendering.

displayString Objectread

The text shown for the current item. Pulled per option; when unbound the item's toString() is used.

selection Object → Objectread and written

Single-select: the selected object. Pulled to mark the selected option (the sole authority when bound); pushed on submit with the chosen item, or null when the noSelectionString option was chosen.

noSelectionString Stringread

When bound, an extra first option with this label meaning "nothing selected"; choosing it pushes null to selection. Pulled.

multiple Objectread

When truthy the element renders as a multi-select and works with selections instead of selection. Pulled.

selections List → Listread and written

Multi-select: the selected objects. Pulled to mark selected options; pushed on submit as a new List of the chosen items. Required when multiple is truthy.

name Stringread

The HTML form-field name. Pulled; auto-assigned from the element ID when unbound — bind it only when other code needs to know the field name.

disabled Objectread

When truthy the field renders with the disabled attribute and its submitted value is ignored (nothing is pushed).

<wo:repetition>

Container
ng.appserver.templating.elements.NGRepetition

Renders its content once per item of list (with item set to the current object) or, alternatively, count times. Exactly one of list and count must be bound. index receives the zero-based iteration number either way.

BindingTypeDescription
list List | SequencedCollectionread

The objects to iterate over: a java.util.List, a Java array, or any SequencedCollection (copied to a list). Pulled once per phase; null is treated as empty. Mutually exclusive with count.

item → Objectwritten

Pushed the current object before each iteration (and reset to null when the repetition finishes). Required when list is bound.

index → Integerwritten

Pushed the zero-based number of the current iteration.

count Integerread

Iterate this many times instead of over a list. Pulled; an integer (a numeric constant in the template is accepted). Mutually exclusive with list.

<wo:resourceURL />

ng.appserver.templating.elements.NGResourceURL

Renders the URL of a webserver resource, for use in your own tags and attributes. Tag name: resourceURL.

BindingTypeDescription
filename required Stringread

The name of the webserver resource in namespace. Pulled; required (a missing resource fails the request).

namespace Stringread

The resource namespace to look filename up in. Pulled; when unbound, the namespace of the component rendering the element is used.

framework Stringread

Legacy name for namespace.

Deprecated.

Use namespace instead — framework is the legacy name, still honoured (with a logged warning).

<wo:script />

ng.appserver.templating.elements.NGJavaScript

Renders a <script src="…"> tag for a webserver resource. Tag name: script.

BindingTypeDescription
filename required Stringread

The name of the JavaScript resource in namespace. Pulled; required. Renders ERROR_NOT_FOUND_<filename> as the URL when the resource doesn't exist.

namespace Stringread

The resource namespace to look filename up in. Pulled; when unbound, the namespace of the component rendering the element is used.

framework Stringread

Legacy name for namespace.

Deprecated.

Use namespace instead — framework is the legacy name, still honoured (with a logged warning).

<wo:str />

ng.appserver.templating.elements.NGString

Renders a value as text. Anything that isn't a string is rendered with toString() (or through formatter when bound). A null value renders nothing at all. HTML is escaped by default.

BindingTypeDescription
value required Objectread

The value to render. Pulled; required. null renders nothing (unless valueWhenEmpty is bound).

valueWhenEmpty Objectread

Rendered instead of value when value is null or an empty string. Pulled.

escapeHTML Booleanread

Whether reserved HTML characters (<, >, &, quotes) are escaped to entities. Must be a Boolean (the value is cast, not interpreted by truthiness). Defaults to true.

Default: true

formatter Formatread

A java.text.Format used to turn value into its string form (format(value)) instead of toString(). Pulled.

<wo:stylesheet />

ng.appserver.templating.elements.NGStylesheet

Renders a <link rel="stylesheet"> tag for a webserver resource. Tag name: stylesheet.

BindingTypeDescription
filename required Stringread

The name of the CSS resource in namespace. Pulled; required. Renders ERROR_NOT_FOUND_<filename> as the URL when the resource doesn't exist.

namespace Stringread

The resource namespace to look filename up in. Pulled; when unbound, the namespace of the component rendering the element is used.

framework Stringread

Legacy name for namespace.

Deprecated.

Use namespace instead — framework is the legacy name, still honoured (with a logged warning).

<wo:submit />

ng.appserver.templating.elements.NGSubmitButton

An <input type="submit"> inside an NGForm. When this button is the one pressed, its action is invoked instead of the form's. Other bindings are rendered as attributes (bind value for the button's label). Tag name: submit.

BindingTypeDescription
action required NGActionResultsread

The component action invoked when this button submits the form. Pulled at invoke time; required.

<wo:switch>

Container
ng.appserver.templating.elements.NGSwitchComponent

Renders the component (or dynamic element) named by componentName, which may change between requests. Every other binding is passed on to the chosen component as its own bindings, and the tag's content becomes the component's content. Tag name: switch.

BindingTypeDescription
componentName required Stringread

The name of the component or element to render. Pulled on every phase; required, and must not resolve to null.

WOComponentName Stringread

Legacy WebObjects name for componentName.

Deprecated.

Use componentName. Accepted for now to ease porting; to be removed.

<wo:text />

ng.appserver.templating.elements.NGText

A <textarea> bound two ways to value: rendered (HTML-escaped) from it, and the submitted text pushed back as a String (null when empty). Other bindings are rendered as attributes. Tag name: text.

BindingTypeDescription
value required Object → Stringread and written

The text. Pulled to render and pushed on submit as a String (null for an empty field). Required.

name Stringread

The HTML form-field name. Pulled; auto-assigned from the element ID when unbound — bind it only when other code needs to know the field name.

<wo:textfield />

ng.appserver.templating.elements.NGTextField

An <input type="text"> bound two ways to value: rendered from it, and the submitted text pushed back into it (as a String, or as whatever formatter parses it to; an empty field pushes null). Other bindings are rendered as attributes. Tag name: textfield.

BindingTypeDescription
value required Object → Object | Stringread and written

The field's value. Pulled to render (formatted via formatter when bound) and pushed on submit — the raw String, null for an empty field, or the object formatter parses. Required.

name Stringread

The HTML form-field name. Pulled; auto-assigned from the element ID when unbound — bind it only when other code needs to know the field name.

disabled Objectread

When truthy the field renders with the disabled attribute and its submitted value is ignored (nothing is pushed).

formatter Formatread

A java.text.Format that formats value for display and parses the submitted text back (parseObject); a parse failure fails the request. Pulled.

Not documented yet