com.raritantechnologies.quickstart.taglibrary.forms
Class ComboBoxSearchElementRenderer

java.lang.Object
  extended bycom.raritantechnologies.quickstart.taglibrary.forms.ComboBoxSearchElementRenderer
All Implemented Interfaces:
IConfigurable, IElementValueBuilder, ISearchElementRenderer, ISessionDataHandler

public class ComboBoxSearchElementRenderer
extends java.lang.Object
implements ISearchElementRenderer, IElementValueBuilder, ISessionDataHandler

SelectElementRenderer that enables user to edit values in a list.

XML Configuration Template:
  <SearchElementRenderer 
       rendererClass="com.raritantechnologies.quickstart.taglibrary.forms.ComboBoxSearchElementRenderer"
       fieldID            = "[ the field ID ]" 
       size               = "[ number of rows to display ]"
       initFrom           = "[ request|lastQuery|dataSource ]"
       initField          = "[ alternate field to init from ]"
       initialSelection   = "[ optional initial select index (1 based) - if not used, nothing is selected on reset ]"
       appendCommand      = "[ command that will cause new value to be appended to current list ]"
       clearCommand       = "[ command that will cause current list to be cleared ]"
       delimiter          = "[ delmiter to use for multi-value strings ]"
       addButton          = "[ on(default)|off ]"
       removeButton       = "[ on(default)|off ]"
       changeButton       = "[ on(default)|off ]"
       textInputField     = "[ on(default)|off ]"
       persistentCacheKey = "[ key to use to persist combo list in sessionData ]"
       useSelect          = "[ true|false ( if false use DHTML version ) ]"
       selectedClass      = "[ CSS class for selected nodes in DHTML version ]"
       unselectedClass    = "[ CSS class for unselected nodes in DHTML version ]"
       unselectedClassAlt = "[ CSS class for odd-numbered unselected nodes in DHTML version ]"
       parentClass        = "[ CSS class for wrapper div in DHTML version ]"
       emptyListMessage   = "[ message to display if no items in the list (DHTL Version only) ]" >

    <Data searchSource         = "[ static name of SearchSource ]"
             sourceNameParam      = "[ name of parameter to get selected search source (dynamic) ]"
             useSourceFields      = "[ false(default) | true - if true use the SearchSource search fields as values ]"
             resultValueField     = "[ field ID(s) from search result that has select value (comma separated) ]"
             alwaysInitialize     = "[ true|false(default) ]"
             dedupeResults        = "[ true|false(default) ]"
             sortResults          = "[ true|false(default) ]"
             noSelectionChoice    = "[ message for non-selection ]"
             blankQueryReturnsAll = "[ true|false(default) ]"
             addQueryFields       = "[ fields from query that should be added to list ]" >

      <!-- Optional query to search source -->
      <Query>
        <!-- one or more query parameter id=value pairs -->
        <Param ID="[ parameter ID ]" value="[ query value ]" />

        <!-- Alternatively search parameters can be derived from the http request -->
        <Param requestField="[ field in http request ]" sourceField="[ name of field in lookup source ]" />
      </Query>

      <!-- Optional StringFilter to filter the data values before insertion into select list -->
      <ValueFilter class=" [ class of com.raritantechnologies.utils.filter.IStringFilter ] " >
      
      </ValueFilter>

    </Data>

    <!-- optional InitFromControl to provide context-dependent control of refresh: -->
    <InitFromControl requestParam="formType" defaultValue="[request|lastQuery|searchSource]" >
      <Request value="[ formType value or 'null' ]"  initFrom="[ one of request|lastQuery|searchSource]" />
    </InitFromControl>

  </SearchElementRenderer>
 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Constructor Summary
ComboBoxSearchElementRenderer()
           
 
Method Summary
 void addDataChoice(java.lang.String choiceVal, java.lang.String choiceName)
           
 void clearDataChoices()
           
 java.lang.String getBody(ISearchFormRenderer parent, RaritanPageContext pageContext)
          Returns the element html fragment.
protected  java.lang.String getDivJavascript(java.lang.String formName)
           
 ISearchElementRenderer getRenderer(java.lang.String name)
          Returns ISearchElementRenderer of this render or a nested renderer matching the name given or null if no match is found.
protected  java.lang.String getSelectJavascript(java.lang.String formName)
           
 void handleSessionData(java.util.Map sessionDataMap, RaritanPageContext pageContext)
          Updates session data parameters handled by this handler and/or updates handler parameters.
 void initialize(org.w3c.dom.Element elem)
          Initialize renderer-specific parameters from the configuration XML tag.
 boolean isHidden(ISearchFormRenderer parent, RaritanPageContext pageContext)
           
 void registerDataHandler(ISessionDataManager manager, java.util.Map params)
          Register this SessionDataHandler with a SessionDataManager.
 void setEnable(boolean enabled)
          Enable/Disable the renderer.
 void setSelectedValues(java.util.ArrayList values)
           
 void setValue(java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComboBoxSearchElementRenderer

public ComboBoxSearchElementRenderer()
Method Detail

clearDataChoices

public void clearDataChoices()
Specified by:
clearDataChoices in interface IElementValueBuilder

addDataChoice

public void addDataChoice(java.lang.String choiceVal,
                          java.lang.String choiceName)
Specified by:
addDataChoice in interface IElementValueBuilder

setValue

public void setValue(java.lang.String value)
Specified by:
setValue in interface IElementValueBuilder

setSelectedValues

public void setSelectedValues(java.util.ArrayList values)
Specified by:
setSelectedValues in interface IElementValueBuilder

getBody

public java.lang.String getBody(ISearchFormRenderer parent,
                                RaritanPageContext pageContext)
Returns the element html fragment.

Specified by:
getBody in interface ISearchElementRenderer

registerDataHandler

public void registerDataHandler(ISessionDataManager manager,
                                java.util.Map params)
Description copied from interface: ISessionDataHandler
Register this SessionDataHandler with a SessionDataManager.

Specified by:
registerDataHandler in interface ISessionDataHandler
Parameters:
manager - The ISessionDataManager that this handler should register with by calling manager.addSessionDataHandler( "handler name", this );
params - Initialization parameters for this handler (typically obtained from the Configuration layer.

handleSessionData

public void handleSessionData(java.util.Map sessionDataMap,
                              RaritanPageContext pageContext)
Description copied from interface: ISessionDataHandler
Updates session data parameters handled by this handler and/or updates handler parameters.

Specified by:
handleSessionData in interface ISessionDataHandler
Parameters:
sessionDataMap - The entire param=value map cached for the current user session. The handler should update any of its params based on the current page context.
pageContext - The current page context. Contains request parameters that the handler should use to update its and/or the SessionData's context.

setEnable

public void setEnable(boolean enabled)
Enable/Disable the renderer. Disabled renderers are not included in the html output of an ISearchFormRenderer.

Specified by:
setEnable in interface ISearchElementRenderer

getRenderer

public ISearchElementRenderer getRenderer(java.lang.String name)
Returns ISearchElementRenderer of this render or a nested renderer matching the name given or null if no match is found.

Specified by:
getRenderer in interface ISearchElementRenderer

isHidden

public boolean isHidden(ISearchFormRenderer parent,
                        RaritanPageContext pageContext)
Specified by:
isHidden in interface ISearchElementRenderer

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: ISearchElementRenderer
Initialize renderer-specific parameters from the configuration XML tag.

Specified by:
initialize in interface ISearchElementRenderer

getSelectJavascript

protected java.lang.String getSelectJavascript(java.lang.String formName)

getDivJavascript

protected java.lang.String getDivJavascript(java.lang.String formName)