Creating User Interfaces
Library WebUI Home

Overview

Startup & Operation Capturing & Displaying data Styling with CSS Sale lifecycle

Examples

Hello World / minimal Online Selling Page

Overrideables

User Message User Prompt Device

In Depth

EventSource realtime feed The Fieldpine Object UI Dispatch Data Fields Global Namespace Scripts

WebView2

Barcode Handling

The Fieldpine Object

When using Fieldpine scripts a "Fieldpine" object is created in the global namespace. This object provides the functions for you to call and also various pieces of state. Some parts of this object are documented and you are expected to change, but you should not use any parts that are not formally documented, they may be removed without warning.

Fieldpine.UIDispatch

This member contains pointers to various functions that can be called. You may replace these pointers with your own functions. UIDispatch is concerned with things that result in visual changes to the User Interface. While you can simply have HTML controls directly call your functions, there are places in Fieldpine scripts that might also need to call these functions, so UIDispatch provides the way you can inform Fieldpine scripts of these overrides.

Button "onclick" function»Fieldpine.UIDispatch»Fieldpine provided default handler
Fieldpine webui script»»Your replacement handler

Dispatch member names are all lowercase.

Example of use

<input type='button' value='New Customer' onclick='FieldpineUI("newcustomer")'>

Internally, this looks at the

Fieldpine.UIDispatch['newcustomer']
field value and routes this call to that handler.

Changing Default Handlers

Replacing with a custom function
    Fieldpine.UIDispatch['newcustomer'] = function(args) { ... };
Replacing to block an action
    Fieldpine.UIDispatch['newcustomer'] = 'block';

UIDispatch Functions

NamePurposeTechnical Notes
popupopen Called begin an expected Popup Screen using zLayer or similar techniques Receives an object with HTML to be displayed and functions to be called at completion eg setFocus() commands
popupclose Close any popup screen
errormessage Display an error message. The default handler calls usermessage Argument may be string or object. If an object is passed the string to display is in "Message"
usermessage Display an unexpected style message to the user. The default handler simply calls alert() Argument may be string or object. If an object is passed the string to display is in "Message"
newcustomer Called to invoke a screen to capture new customer details.

Fieldpine.DataFields

This object holds a list of fields that describe a product/customer etc. Fieldpine is extensible and "all attributes" for a product etc can result in very large data transfers or slow processing times. If your interface requires additional fields beyond typical use, you can list additional fields here. Of course, advanced users or custom javascript can directly call the server(s) themselves and retrieve additional attributes, this object is enhancing the standard definition

These values should be set at the initial load stage. Adding more fields at a later stage may not invalidate cache entries that do not have that data loaded.

To request that product records include the fields ISBN and selling message, simply set this field.

    Fieldpine.DataFields['products'] = "isbn,sellingmessage";

Or, for if you have precise customer requirements

    Fieldpine.DataFields['customers'] = "firstname,lastname,lastsale,lastcontactdt";