Big Sister Web Application Framework
Functions | Variables
forms.js File Reference

Functions

function UpdateListResult (result, list)
 Store the members of a list in a text field.
function RemoveFromList (result, where)
 
Remove the selected entry from a list field and update the

associated text field.

function AddToList (result, what, where)
 
Add the value of a field to a list field and update the associated

text field.

function unselectList (list)
 Clear selection of a list.
function selectList (list)
 Select all elements of a list.
function ListAddElement (value, where)
 Add a value to a list.
function ListRemoveAndGet (from)
 Remove selected elements from list and return the value of the last one.
function ListSelMove (from, to)
 Move selected entries from list from to list to.
function ListCopy (from, to)
 Copy a list from one <select> element to the other.
function ListRemove (what, from)
 Remove every element in one <select> element from a 2nd one.
function ListEmptyMark (list)
 Add the pseudo-element <empty> to a list if the list is empty.
function unselect_panel ()
 Hide the currently displayed panel.
function select_panel (id)
 Display the panel with the given name.
function form_selection_sel (selector, target)
 Copies the value of a "selector" field over to a target field.
function form_popup (interface1, interface2, uri, params)
 Display a popup windows with the given URI and parameters.
function getInterfaceField (which)
 
Find an return the interface field associated with the current popup

window.

function refreshParent ()
 
Finds parent window(s) of the current window and sends them a "refresh"

request if they are willing to get one.

function forms_onload ()
new SwafOnload (forms_onload)
 Wraps a function to be called on document load.

Variables

var list_magic = "_%%%empty%%%_"
var selected_panelid = "panel1"
 The name of the currently displayed panel.

Function Documentation

function AddToList (   result,
  what,
  where 
)

Add the value of a field to a list field and update the associated

text field.

Parameters
resultText field
whatField to add to the list
whereList field

References ListEmptyMark(), and UpdateListResult().

function form_popup (   interface1,
  interface2,
  uri,
  params 
)

Display a popup windows with the given URI and parameters.

Stores a reference to the current/parent window in the interface_window element of the new windows. Passes the name of the interface field on to the popup windows as the window name. Remembers the interface2 pointer in the interface1.interface2 field.

function form_selection_sel (   selector,
  target 
)

Copies the value of a "selector" field over to a target field.

function forms_onload ( )

References select_panel(), and selected_panelid.

function getInterfaceField (   which)

Find an return the interface field associated with the current popup

window.

This function requires the name of the current window to be equal with the name of the interface field in the parent window. If the which parameter is zero, then the interface field itself is returned, otherwise the second interface field (found in the interface2 field of the main interface field) is returned.

See Also
form_popup()
function ListAddElement (   value,
  where 
)

Add a value to a list.

Parameters
valueValue to add
whereList field

References ListEmptyMark(), and unselectList().

function ListCopy (   from,
  to 
)

Copy a list from one <select> element to the other.

function ListEmptyMark (   list)

Add the pseudo-element <empty> to a list if the list is empty.

Remove the <empty>-element if the list is not empty any more.

References list_magic.

Referenced by AddToList(), ListAddElement(), ListRemove(), ListRemoveAndGet(), ListSelMove(), and RemoveFromList().

function ListRemove (   what,
  from 
)

Remove every element in one <select> element from a 2nd one.

References ListEmptyMark().

function ListRemoveAndGet (   from)

Remove selected elements from list and return the value of the last one.

Parameters
fromList field

References list_magic, and ListEmptyMark().

function ListSelMove (   from,
  to 
)

Move selected entries from list from to list to.

References list_magic, ListEmptyMark(), and unselectList().

function refreshParent ( )

Finds parent window(s) of the current window and sends them a "refresh"

request if they are willing to get one.

In order to find out if the parent is accepting refresh requests this procedure tests if a form field called "autorefresh" exists. If yes, the field's value is set to 1 and the surrounding form is submitted.

function RemoveFromList (   result,
  where 
)

Remove the selected entry from a list field and update the

associated text field.

Parameters
resultText field
whereList field

References ListEmptyMark(), and UpdateListResult().

function select_panel (   id)

Display the panel with the given name.

Automatically hides the currently displayed panel, before displaying the new one. The panel is expected to have the id attribute set to "panel(id)".

If an element with id "panel(id)tab" exists, this is expected to be an element in the tab space to be displayed if the respective panel is selected (for highlighting ...).

Usually, the respective non-highlighted tab element will have an id "panel(id)anchor" and the element itself will be "position: absolute". In this case select_panel() will position the highlighted element at the position of the non-highlighted element.

Since the highlighted element might replace more than just the non-highlighted tab, another mechanism helps positioning: one element within the highlighted element may have an id "panel(id)bolt" and one element within the tab must then have an id "panel(id)anchor". select_panel() will position the highlighted element so that the bolt and anchor elements are both at the same position.

When a panel is selected and an element with name "selected_panel" exists, then the id of the selected panel is stored in this elements value (it's supposed to be a "hidden" input field). On document load forms_onload() will select the panel named in the selected_panel field (if existant, otherwise panel1 will be selected).

References getPageOffsetLeft(), getPageOffsetTop(), selected_panelid, and unselect_panel().

Referenced by forms_onload().

function selectList (   list)

Select all elements of a list.

new SwafOnload ( onloadCallback  )

Wraps a function to be called on document load.

Handles the browser dependent ways of "onload" functionality.

SYNOPSIS

function callme() {
alert( "document has been loaded" );
}
new SwafOnload( callme );

Registers object as one that has to be called on load.

Invoked by SwafOnload_call() after the document has been loaded. Usually this calls the callback function registered via the constructor.

callback function

function unselect_panel ( )

Hide the currently displayed panel.

References selected_panelid.

Referenced by select_panel().

function unselectList (   list)

Clear selection of a list.

Referenced by ListAddElement(), and ListSelMove().

function UpdateListResult (   result,
  list 
)

Store the members of a list in a text field.

The list members are concatenated with a separator ':;:' between them.

Parameters
resultText field the result should be put in
listList field

References list_magic.

Referenced by AddToList(), and RemoveFromList().

Variable Documentation

var list_magic = "_%%%empty%%%_"
var selected_panelid = "panel1"

The name of the currently displayed panel.

Referenced by forms_onload(), select_panel(), and unselect_panel().