Package Documentation

Object: SKELETON-UI-ELEMENT (The :GWL Package)
Mixins: VANILLA-MIXIN

Description

Basic mixin to support constructing a gdl ajax call relative to this node. Note that in order for a node to represent a section of a web page, you should use sheet-section (which mixes this in), rather than this raw primitive. This is a mixin into base-html-sheet, and some of the previous base-html-sheet functionality has been factored out into this mixin. Of special note in this object is the function gdl-ajax-call which generates Javascript appropriate for attaching with a UI event, e.g. onclick, onchange, onblur, etc. In this Javascript you can specify a GDL function (on this object, self) to be run, and/or specify a list of form-control objects which are rendered on the current page, whose values should be submitted and processed ("bashed") into the server.


Input Slots (optional)

BASHEE gdl object

Object to have its settable computed-slots and/or query-plist set from the fields on the form upon submission. Defaults to self.


DOM-ID string

This is the auto-computed dom-id which should be used for rendering this section. If you use the main-div HTML string for rendering this object as a page section, then you do not have to generate the :div tag yourself - the main-div will be a string of HTML which is wrapped in the correct :div tag already.


FORCE-VALIDATION-FOR list of gdl objects of type form-control

The validation-function will be forced on these objects when a form is submitted, even if the object's html form-control does not happen to be included in the values submitted with the form. Defaults to nil.


HIDDEN? [from VANILLA-MIXIN*] boolean

Indicates whether the object should effectively be a hidden-object even if specified in :objects. Default is nil.


HTML-SECTIONS

List of HTML sections to be scanned and possibly replaced in response to GDL Ajax calls. Override this slot at your own risk. The default is all sections who are most recently laid out on the respondent sheet, and this is set programmatically every time the sheet section's main-div is demanded.


HTML-SECTIONS-VALID

List of valid HTML sections to be scanned and possibly replaced in response to GDL Ajax calls. Override this slot at your own risk. The default is all sections who are most recently laid out on the respondent sheet, and this is set programmatically every time the sheet section's main-div is demanded.


INNER-HTML string

This can be used with (str .) [in cl-who] or (:princ .) [in htmlGen] to output this section of the page, without the wrapping :div tag [so if you use this, your code would be responsible for wrapping the :div tag with :id (the dom-id).]


JS-TO-EVAL string of valid javascript

This Javascript will be send with the Ajax response, and evaluated after the innerHTML for this section has been replaced.


ORDERED-FORM-CONTROLS list of gdl objects, which should be of type 'base-form-control

.

[Note -- this slot is not really necessary for protecting out-of-bounds sequence references anymore, the form-control processor protects against this by itself now].

These objects are validated and bashed first, in the order given. If the cardinality of one form-control depends on another as in the example below, then you should list those dependent objects first. Default is nil.

examples:
 
...
  
  :computed-slots ((number-of-nozzles (the number-of-nozzles-form value))
	    (ordered-form-controls 
	     (append (list-elements (the inner-flange-form))
		     (list (the number-of-nozzles-form)))))
  
  :objects
  ((inner-flange-form
    :type 'menu-form-control 
    :choice-plist (list :hey "hey" :now "now")
    :default :hey
    :sequence (:size (the number-of-nozzles)))
   (number-of-nozzles-form
    :type 'text-form-control 
    :prompt "Number of Shell Nozzles Required: "
    :domain :number     
    :default 0)

POSSIBLE-NILS list of keyword symbols

Messages corresponding to form fields which could be missing from form submission (e.g. checkbox fields). Defaults to the names of any children or hidden-children of type menu-form-control or checkbox-form-control.


PRESET-ALL? boolean

This switch determines whether all form-controls should be preset before the final setting, in order to allow any interdependencies to be detected for validation or detecting changed values. If this is specified as a non-nil value, then any nil values of (the preset?) on individual form controls will be ignored. If this is specified as nil, then (the preset?) of individual form-controls (default of these is also nil) will be respected. Default is nil.


ROOT [from VANILLA-MIXIN*] gdl instance

The root-level node in this object's ``tree'' (instance hierarchy).


SAFE-CHILDREN [from VANILLA-MIXIN*] list of gdl instances

All objects from the :objects specification, including elements of sequences as flat lists. Any children which throw errors come back as a plist with error information


STRINGS-FOR-DISPLAY [from VANILLA-MIXIN*] string or list of strings

Determines how the name of objects of this type will be printed in most places. This defaults to the name-for-display (generally the part's name as specified in its parent), followed by an index number if the part is an element of a sequence.


VISIBLE-CHILDREN [from VANILLA-MIXIN*] list of gdl instances

Additional objects to display in Tatu tree. Typically this would be a subset of hidden-children. Defaults to NIL.



Input Slots (optional, defaulting)

RESPONDENT gdl object

Object to respond to the form submission. Defaults to self.



Computed Slots

FAILED-FORM-CONTROLS list of gdl objects

All the form-controls which do not pass validation.


FORM-CONTROLS list of gdl objects

All the children or hidden-children of type base-form-control.


MAIN-DIV% string

This should be used with (str .) [in cl-who] or (:princ .) [in htmlGen] to output this section of the page, including the wrapping :div tag.



GDL Functions

GDL-AJAX-CALL string

. This function returns a string of Javascript, appropriate to use for events such as :onclick, :onchange, etc, which will invoke an Ajax request to the server, which will respond by replacing the innerHTML of affected :div's, and running the Javascript interpreter to evaluate (the js-to-eval), if any.

examples:
"
 
 FLAG -- Fill in!!!
"
keyword arguments:
bashee GDL Object, Default Value: (THE BASHEE)
This object will have the function-key called on it, if any
respondent GDL Object, Default Value: (THE RESPONDENT)
This must be the object which represents the actual web page being used
function-key Keyword symbol, Default Value: NIL
This keyword symbol must name a GDL function or method which is to be invoked with the Ajax call
arguments List of values, Default Value: NIL
This is the argument list on which the function named by function-key will be applied
form-controls List of GDL objects of type base-form-control, Default Value: NIL
Each of the objects in this list will have its current value (as entered by the user) scraped from the web page and its value in the model
bashed to reflect what has been entered on the page, Default Value: NIL

Examples


 FLAG -- Fill in!!!

Package Documentation