class %ZEN.Portal.selector
extends %ZEN.Component.control
Selector component for Portal applications.
This is a specialized form of text control that
allows for free form text entry or context-aware selection from a list.
parameter DEFAULTCONTROLCLASS = "selectorInput";
The default css class used for the main element within this control. This
is overridden by subclasses.
property context
as %ZEN.Datatype.uri;
Context string used to determine the selection list for this component.
A context string take the form of a URL:
SearchClass/SearchName?parm1=value&parm2=value
SearchClass is the name of a %ZEN.Portal.ContextSearch
search class that contains the search to perform.
SearchName is the name of the search method to invoke within
the search class.
property multiSelect
as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
Flag to indicate whether multiSelect mode should be used when displaying the dropdown menu.
If this value is true, then the contents of the control are treated as a delimited list using
separator as the delimiter. The dropdown will then present the user with a list
of checkboxes with the previously entered values checked. Checking and unchecking values will toggle
whether the property is included in the list.
NOTE: MultiSelect mode should not be used in conjunction with context-based lookups, as the behaviour
which could come from this approach would not be intuitive or easy to use.
property onkeyup
as %ZEN.Datatype.eventHandler(HANDLER="""_$select((..onkeyup'=""""): ""return zenFireEvent('""_..index_""','""_$ZCVT($S(..onkeydown'[""#("":..onkeydown,1:..%Eval(..onkeydown,""JS"")),""O"",""JS"")_""','onkeydown',event);"", 1: ""zenPage.getComponent(""_..index_"").onkeyupHandler(event,""_..index_"");"")_""");
onkeyup event handler:
This event is fired when a key is released when this control has focus.
The HANDLER parameter is used to trigger the default onkeyup handler defined in
onkeyupHandler(). If onkeyup is specified in the component,
then that specific code will be invoked rather than that in the default event handler, and it
is then the responsibility of the developer to call the onkeyupHandler() function
defined in this class.
property separator
as %ZEN.Datatype.string [ InitialExpression = "," ];
Define what delimiter to use for list properties when multiSelect is true.
property size
as %ZEN.Datatype.integer(MINVAL=0);
Size of the input area for this text control.
method %DrawHTML()
Draw content of control.
classmethod %RenderDropdown(pIndex As %Integer, pContext As %String, pSearchKey As %String, pMultiSelect As %Boolean, pSeparator As %String = ",")
as %Status
Render the HTML contents of the dropdown area for the selector.
pContext is the (resolved) context string for the control.
pSearchKey is the current contents of the control.
pMultiSelect is a flag to indicate whether a multiSelect dropdown should be displayed.
pSeparator indicates which separator character should be used if pMultiSelect is true.
classmethod RenderDropdownContent(pIndex As %Integer, pContext As %String, pSearchKey As %String, pMultiSelect As %Boolean, pSeparator As %String = ",")
as %Boolean
[ ZenMethod ]
Get the HTML contents of the dropdown area for the selector.
pContext is the (resolved) context string for the control.
pSearchKey is the current contents of the control.
pMultiSelect is a flag to indicate whether a multiSelect dropdown should be displayed.
pSeparator indicates which separator character should be used if pMultiSelect is true.
method adjustSize()
[ Language = javascript ]
Adjust size of control.
method getModalDiv()
[ Language = javascript ]
Find the div element used to display modal popups.
method onDisplayHandler()
[ Language = javascript ]
This client event, if present, is fired when the containing group is made visible.
method onEndModalHandler(zindex)
[ Language = javascript ]
Notification that this component is about to stop being modal.
method onStartModalHandler(zindex)
[ Language = javascript ]
Notification that this component is about to become modal.
method onkeyupHandler(event, index)
[ Language = javascript ]
Default onkeyup handler to allow drop-down to be displayed (by pressing DOWN)
or hidden (by pressing ESCAPE). This method is only invoked if no onkeyup event
is defined for the selector using the standard onkeyup attribute. Should a developer
make use of the onkeyup callback, it is his/her responsibility to determine whether
this function should be invoked.
method onloadHandler()
[ Language = javascript ]
This client event, if present, is fired when the page is loaded.
method selectItem(value)
[ Language = javascript ]
User has selected an item in the dropdown list.
method setProperty(property, value, value2)
[ Language = javascript ]
Set the value of a named property.
method showSelector()
[ Language = javascript ]
User has pressed the selector button.