com.raritantechnologies.searchApp.taglibrary
Class SortOrderDropDownCntl

java.lang.Object
  extended byBodyTagSupport
      extended bycom.raritantechnologies.searchApp.taglibrary.SortOrderDropDownCntl
All Implemented Interfaces:
IConfigurable, ICustomTag, ISearchElementRenderer

public class SortOrderDropDownCntl
extends BodyTagSupport
implements ICustomTag, ISearchElementRenderer

This class creates a select list with the names of the sortable fields and also creates two radio buttons for ascending and descending order.

TO DO: Change origin of sortable fields from session data to configuration layer.

It needs a tag in the SearchForm.tld file like:

    <tag>
        <name>SortOrderDropDown</name>
        <tag-class>com.raritantechnologies.verity.searchApp.SortOrderDropDown</tag-class>
        <body-content>JSP</body-content>
        <attribute>
            <name>dropdownName</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
      <attribute>
          <name>onChangeScript</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
      </attribute>
    </tag>
 
XML Configuration Template:
  <SearchElementRenderer rendererClass="com.raritantechnologies.searchApp.taglibrary.SortOrderDropDownCntl" 
                            dropdownName="[ field name of dropdown ]"
                            script="[ javascript function for on select ]" >

    <Fields>
      <Field ID="[ field ID to sort on ]" display="[ display name of field ]" />
      <Field ID="[ another field ID ]"    display="[ another display name ]" />
    </Fields>

  </SearchElementRenderer>
 

Developed by Raritan Technologies .

Author:
Alan Connell
See Also:
Serialized Form

Constructor Summary
SortOrderDropDownCntl()
           
 
Method Summary
 int doAfterBody()
           
 int doStartTag()
           
 java.lang.String getBody(ISearchFormRenderer parent, RaritanPageContext pageContext)
          Returns the element html fragment.
 java.lang.String getBody(RaritanPageContext rpc)
          Returns the tag body.
 java.lang.String getdropdownName()
           
 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.
 java.lang.String getscript()
           
 void initialize(org.w3c.dom.Element elem)
          Initialize renderer-specific parameters from the configuration XML tag.
 void initialize(java.util.Map initParams)
           
 boolean isHidden(ISearchFormRenderer parent, RaritanPageContext pageContext)
           
 void setDropdownName(java.lang.String dropdownName)
           
 void setEnable(boolean enabled)
          Enable/Disable the renderer.
 void setScript(java.lang.String script)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortOrderDropDownCntl

public SortOrderDropDownCntl()
Method Detail

setDropdownName

public void setDropdownName(java.lang.String dropdownName)

getdropdownName

public java.lang.String getdropdownName()

setScript

public void setScript(java.lang.String script)

getscript

public java.lang.String getscript()

doStartTag

public int doStartTag()
               throws JspException
Throws:
JspException

getBody

public java.lang.String getBody(RaritanPageContext rpc)
Description copied from interface: ICustomTag
Returns the tag body.

Specified by:
getBody in interface ICustomTag
Parameters:
rpc - Platform-neutral page context ( can be used in non J2EE environments such as ASP).
Returns:
The tag body text string.

doAfterBody

public int doAfterBody()
                throws JspException
Throws:
JspException

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 IConfigurable

initialize

public void initialize(java.util.Map initParams)
Specified by:
initialize in interface ICustomTag

getBody

public java.lang.String getBody(ISearchFormRenderer parent,
                                RaritanPageContext pageContext)
Description copied from interface: ISearchElementRenderer
Returns the element html fragment.

Specified by:
getBody in interface ISearchElementRenderer

setEnable

public void setEnable(boolean enabled)
Description copied from interface: ISearchElementRenderer
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)
Description copied from interface: ISearchElementRenderer
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