Skip to content

Pluggable Widget Layer

dthume edited this page Oct 14, 2010 · 2 revisions

The current xsltforms implementation has a (fairly) tight coupling between the "core" xforms logic and the actual runtime widgets used to present controls to the user. For example, XFInput examines the xsd type of the node to which it is bound, and then instantiates the appropriate text input, checkbox or date picker. We would like to support customisation of the widgets used for presentation, including adding new widgets to support types which currently fall back on "standard" controls (e.g. a colour picker). We would like such customisations to be possible without modification to the core xsltforms codebase; users should be able to specify the widget strategy using config.xml or some similar mechanism.

In order to accomplish this, we need the following:

  • Removal of presentation related logic from the xsl (e.g. currently a xf:secret field will result in the xsl outputting a html input with a type of password).

  • Removal of presentation related logic from the xform control javascript objects (XFInput etc.).

  • Definition of a widget "interface" i.e. a set of methods which enable the javascript control objects to work with widgets without being aware of the specific widget implementation details

  • Implementation of some form of lookup strategy for widgets, which can be used by controls to get the appropriate widget for a specific control based on the control type, the data type, the value of the appearance and inputmode attributes, and any other relevant criteria.

  • Refactoring of control objects to use the lookup strategy (replacing the presentation logic removed above)

  • Mechanism for registering new widgets with the lookup strategy

Clone this wiki locally