|
NAMEJifty::Web::Form::Element - Some item that can be rendered in a formDESCRIPTIONDescribes any HTML element that might live in a form, and thus might have javascript on it.Handlers are placed on Jifty::Web::Form::Element objects by calling the name of the javascript event handler, such as "onclick" or "onchange", with a set of arguments. The format of the arguments passed to "onclick" (or any similar method) is a string, a hash reference, or a reference to an array of multiple hash references. Strings are inserted verbatim. Hash references can take a number of possible keys. The most important is the mode of the fragment replacement, if any; it is specified by providing at most one of the following keys:
The following options are also supported:
handlersThe following handlers are supported:onclick onchange ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onfocus onblur onkeypress onkeydown onkeyup onselect NOTE: onload, onunload, onsubmit and onreset are not yet supported WARNING: if you use the onclick handler, make sure that your javascript is "return (function name);", or you may well get a very strange-looking error from your browser. accessorsAny descendant of Jifty::Web::Form::Element should be able to accept any of the event handlers (above) as one of the keys to its "new" parameter hash.new PARAMHASH OVERRIDECreate a new "Jifty::Web::Form::Element" object blessed with PARAMHASH, and set with accessors for the hash values in OVERRIDE.onclickThe onclick event occurs when the pointing device button is clicked over an element. This attribute may be used with most elements.onchangeThe onchange event occurs when a control loses the input focus and its value has been modified since gaining focus. This handler can be used with all form elements.ondblclickThe ondblclick event occurs when the pointing device button is double clicked over an element. This handler can be used with all form elements.onmousedownThe onmousedown event occurs when the pointing device button is pressed over an element. This handler can be used with all form elements.onmouseupThe onmouseup event occurs when the pointing device button is released over an element. This handler can be used with all form elements.onmouseoverThe onmouseover event occurs when the pointing device is moved onto an element. This handler can be used with all form elements.onmousemoveThe onmousemove event occurs when the pointing device is moved while it is over an element. This handler can be used with all form elements.onmouseoutThe onmouseout event occurs when the pointing device is moved away from an element. This handler can be used with all form elements.onfocusThe onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation. This handler can be used with all form elements.onblurThe onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation. This handler can be used with all form elements.onkeypressThe onkeypress event occurs when a key is pressed and released over an element. This handler can be used with all form elements.onkeydownThe onkeydown event occurs when a key is pressed down over an element. This handler can be used with all form elements.onkeyupThe onkeyup event occurs when a key is released over an element. This handler can be used with all form elements.onselectThe onselect event occurs when a user selects some text in a text field. This attribute may be used with the text and textarea fields._handler_setupThis method is used by all handlers to normalize all arguments.handlers_usedReturns the names of javascript handlers which exist for this element.javascriptReturns the javascript necessary to make the events happen, as a string of HTML attributes.javascript_attrsReturns the javascript necessary to make the events happen, as a hash of attribute-name and value.javascript_preemptReturns true if the the javascript's handlers should prevent the web browser's standard effects from happening; that is, for "onclick", it prevents buttons from submitting and the like. The default is to return true, but this can be overridden.classSets the CSS class that the element will display astitleSets the title that the element will display, e.g. for tooltipskey_bindingSets the key binding associated with this elementkey_binding_labelSets the key binding label associated with this element (if none is specified, the normal label is used instead)idSubclasses must override this to provide each element with a unique id.labelSets the label of the element. This will be used for the key binding legend if key_binding_label is not set.key_binding_javascriptReturns the javascript fragment to add key binding for this input, if one exists.render_key_bindingRenders the javascript from "key_binding_javscript" in a <script> tag, if needed.handler_allowed HANDLER_NAMEReturns 1 if the handler (e.g. onclick) is allowed. Undef otherwise.The set defined here represents the typical handlers that are permitted. Derived classes should override if they stray from the norm. By default we allow: onchange onclick ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onfocus onblur onkeypress onkeydown onkeyup
Visit the GSP FreeBSD Man Page Interface. |