Zimlet JavaScript API Reference - ZmAddressInputField

Class ZmAddressInputField


This class creates and manages a control for entering email addresses and displaying them in bubbles. An address's surrounding bubble can be used to remove it, or, if the address is a distribution list, expand it. They can be dragged to other address fields, or reordered within this one. They can be selected via a "rubber band" selection box. The bubbles support a few shortcuts. It is not a DwtInputField. If you don't want bubbles, use that (or a native INPUT) instead.

Defined in: ZmAddressInputField.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmAddressInputField(params, autocompleteListView, inputId, templateId, type, strictMode, bubbleAddedCallback, bubbleRemovedCallback, bubbleMenuCreatedCallback, bubbleMenuResetOperationsCallback, noOutsideListening)
Creates an address input field that shows addresses as bubbles.
Method Summary
Method Attributes Method Name and Description
 
addBubble(params, address, match, bubble, index, skipNotify, noFocus, addClass, noParse)
Creates a bubble for the given address and adds it into the holding area.
 
addValue(text, skipNotify)
Adds address(es) to the input.
 
clear(skipNotify)
Removes all bubbles from the holding area.
 
getAddresses(asObjects)
Returns an ordered list of bubble addresses.
 
getSelection(bubble)
Returns a list of the currently selected bubbles.
 
Returns a string of concatenated bubble addresses.
 
handleDelete(checkInput)
Removes the selected bubble.
<static>  
ZmAddressInputField.onHolderKeyClick(ev)
Handle arrow up, arrow down for bubble holder
<static>  
ZmAddressInputField.onPaste(ev)
Makes bubbles out of addresses in pasted text.
<static>  
ZmAddressInputField.removeBubble(bubbleId, skipNotify)
Removes the bubble with the given ID from the holding area.
 
removeBubble(bubbleId, skipNotify)
Removes the bubble with the given ID from the holding area.
 
Sets the value of the input without looking for email addresses.
 
setSelected(bubble, selected)
Sets selection of the given bubble.
 
setValue(text, add, skipNotify, invokeAutocomplete)
Parses the given text into email addresses, and adds a bubble for each one that we don't already have.
Class Detail
ZmAddressInputField(params, autocompleteListView, inputId, templateId, type, strictMode, bubbleAddedCallback, bubbleRemovedCallback, bubbleMenuCreatedCallback, bubbleMenuResetOperationsCallback, noOutsideListening)
Creates an address input field that shows addresses as bubbles.
Author: Conrad Damon.
Parameters:
{hash} params
hash of params:
{ZmAutocompleteListView} autocompleteListView
associated autocomplete control
{string} inputId
an explicit ID to use for the control's INPUT element
{string} templateId
custom template to use
{string} type
arbitrary type to uniquely identify this among others
{boolean} strictMode
if true (default), bubbles must contain valid addresses
{AjxCallback|function} bubbleAddedCallback
called when a bubble is added
{AjxCallback|function} bubbleRemovedCallback
called when a bubble is removed
{AjxCallback|function} bubbleMenuCreatedCallback
called when the action menu has been created
{AjxCallback|function} bubbleMenuResetOperationsCallback
called when the action menu has reset its operations
{boolean} noOutsideListening
don't worry about outside mouse clicks
Method Detail
addBubble(params, address, match, bubble, index, skipNotify, noFocus, addClass, noParse)
Creates a bubble for the given address and adds it into the holding area. If the address is a local group, it is expanded and the members are added individually.
Parameters:
{hash} params
hash of params:
{string} address
address text to go in the bubble
{ZmAutocompleteMatch} match
match object
{ZmAddressBubble} bubble
bubble to clone
{int} index
position (relative to bubbles, not elements) at which to add bubble
{boolean} skipNotify
if true, don't call bubbleAddedCallback
{boolean} noFocus
if true, don't focus input after bubble is added
{string} addClass
additional class name for bubble
{boolean} noParse
if true, do not parse content to see if it is an address

addValue(text, skipNotify)
Adds address(es) to the input.
Parameters:
{string} text
email addresses
{boolean} skipNotify
if true, don't call bubbleAddedCallback

clear(skipNotify)
Removes all bubbles from the holding area.
Parameters:
skipNotify

getAddresses(asObjects)
Returns an ordered list of bubble addresses.
Parameters:
{boolean} asObjects
if true, return list of AjxEmailAddress

getSelection(bubble)
Returns a list of the currently selected bubbles. If a bubble has been selected via right-click, but is not part of the current left-click selection, only it will be returned.
Parameters:
{ZmAddressBubble} bubble
reference bubble

getValue()
Returns a string of concatenated bubble addresses.

{boolean} handleDelete(checkInput)
Removes the selected bubble. If none are selected, selects the last one.
Parameters:
{boolean} checkInput
if true, make sure INPUT is empty
Returns:
{boolean} true if the delete selected or removed a bubble

<static> ZmAddressInputField.onHolderKeyClick(ev)
Handle arrow up, arrow down for bubble holder
Parameters:
ev

<static> ZmAddressInputField.onPaste(ev)
Makes bubbles out of addresses in pasted text.
Parameters:
ev

<static> ZmAddressInputField.removeBubble(bubbleId, skipNotify)
Removes the bubble with the given ID from the holding area.
Parameters:
{string} bubbleId
ID of bubble to remove
{boolean} skipNotify
if true, don't call bubbleRemovedCallback

removeBubble(bubbleId, skipNotify)
Removes the bubble with the given ID from the holding area.
Parameters:
{string} bubbleId
ID of bubble to remove
{boolean} skipNotify
if true, don't call bubbleRemovedCallback

setInputValue(text)
Sets the value of the input without looking for email addresses. No bubbles will be added.
Parameters:
{string} text
new input content

setSelected(bubble, selected)
Sets selection of the given bubble.
Parameters:
{Element} bubble
bubble to select
{boolean} selected
if true, select the bubble, otherwise deselect it

setValue(text, add, skipNotify, invokeAutocomplete)
Parses the given text into email addresses, and adds a bubble for each one that we don't already have. Since text is passed in, we don't recognize expandable DLs. A bubble may be added for a string even if it doesn't parse as an email address.
Parameters:
{string} text
email addresses
{boolean} add
if true, control is not cleared first
{boolean} skipNotify
if true, don't call bubbleAddedCallback
{boolean} invokeAutocomplete
if true, trigger autocomplete (useful in paste event when keyup/down events don't take place

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:40 GMT-0400 (EDT)