Class Index | File Index

Classes


Class adf.Toc


Extends adf.Control.

Defined in: Toc.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
adf.Toc(id, cont, mapId, ren)
The Toc control displays the table of contents of resources, layers and symbols of the data displayed in the map.
Field Summary
Field Attributes Field Name and Description
 
Whether every node operation must submit request to server.
 
Whether to submit request through postback.
 
Root div within which toc control is rendered.
 
Id of map control with which this toc control is bound.
 
List of toc nodes rendered in this toc control
 
Toc renderer object to render the toc's content.
 
Ending string identifying a token.
 
List of callback functions to handle tokens.
 
List of tokens handled by thistoc.
 
Starting string identifying a token.
Fields borrowed from class adf.Control:
bounds, divObject, id, type, updateListenerNames, updateListeners
Method Summary
Method Attributes Method Name and Description
 
addTocNode(k, lb, lv, isSE, isE, isSC, isC, isU, iU, isDi, isS, mi)
Adds an adf.TocNode with the state defined by the arguments which are described below.
 
addTokenHandler(name, handlerFunction)
This method is used to add the token alongwith with its associated handler function to the Toc
 
Sends request to server with params for checkbox operation
 
Sends context menu operation params to server
 
init(cont)
Initialize toc control within container specified in the argument
 
nodeOperation(k, o, params)
Sends request to server with node operation specified through a key and its associated operation This can also be specified by params object literal.
 
updateAsync(xml, eventSources)
Postback tag handler function which is responsible for updating toc control during postback
Methods borrowed from class adf.Control:
addUpdateListener, removeUpdateListener
Methods borrowed from class adf.PageElement:
hide, resize, show
Class Detail
adf.Toc(id, cont, mapId, ren)
The Toc control displays the table of contents of resources, layers and symbols of the data displayed in the map. It is also used in the WebADF to display results of queries performed in the web application. Creates a new toc control with argument id, within argument container and bound to map with argument mapId. A toc renderer may be specified to render the nodes in the toc
Parameters:
{String} id
Id of Toc control. Maps to the JSF toc tag's id attribute
{DOMElement} cont
The rendering Container of the Toc Control.
{String} mapId
Id of map control with which this toc control is bound. Maps to the JSF toc tag's mapId attribute
{adf.TocRenderer} ren
The Toc Renderer for this instance of Toc Control.*
Field Detail
{Boolean} autoPostBack
Whether every node operation must submit request to server. Maps to the JSF toc tag's autoPostBack attribute.
Default Value:
true

{Boolean} clientPostBack
Whether to submit request through postback. Maps to the JSF toc tag's clientPostBack attribute. Default is false
Default Value:
false

{String} divId
Root div within which toc control is rendered.
Default Value:
"TocDiv_adf.Toc#id"

{String} mapId
Id of map control with which this toc control is bound. Maps to the JSF toc tag's mapId attribute

{Array} nodes
List of toc nodes rendered in this toc control

{adf.TocRenderer} renderer
Toc renderer object to render the toc's content. Default is EsriTableTocRenderer
Default Value:
adf.TableTocRenderer

{String} tokenEnd
Ending string identifying a token.
Default Value:
"}"

{Array} tokenHandlers
List of callback functions to handle tokens. See {@adf.Toc#tokens} for more details

{Array} tokens
List of tokens handled by thistoc.

Tokens are code snippets that are contained as part of the adf.TocNode's label, in the format: [adf.Toc#tokenStarttokenadf.Toc#tokenEnd]. For example in a GP Task , we like to save the results obtained by the execution of the GP Task, we can add a token with a corresponding handler to save the result by providing a link to each result node. users can add custom tokens to Toc Control also. These are rendered by the Web ADF and the adf.TocRenderer has the choice to render the token or ignore it. See adf.Toc#tokenStart and adf.Toc#tokenEnd to see the separator. A token handler function has the following signature. These have been added to let the server code be agnostic of the toc rendering. HTMLElement callback(String key, String label) The function returns an HTMLElement to be added while rendering the toc node/context menu item To add Token Handlers use adf.Toc#addTokenHandler TOC Tokens Summary: The description below lists how the adf.TableTocRenderer which is the default renderer for adf.Toc#renderer, handles these tokens.


Token
Handler function
Description
${loading-image}
Image callback(String key, String token)
Adds the "images/loading.gif" image as part of the label of the node
${url(uri)(label)}
HTMLAnchorElement callback(String key, String token) Renders a adf.TocNode
${imgsrc= src}
Image callback(String key, String token) Adds an <img src="src" /> tag within the toc node
${save-gp-result} HTMLTableCellElement callback(String key, String token, String label) Adds a table cell to request saving of GP task result
${show-copyright} HTMLTableCellElement callback(String key, String token, String label) Adds a table cell to request and display the data source's copyright information


{String} tokenStart
Starting string identifying a token.
Default Value:
"${"
Method Detail
addTocNode(k, lb, lv, isSE, isE, isSC, isC, isU, iU, isDi, isS, mi)
Adds an adf.TocNode with the state defined by the arguments which are described below. String key, String label, Number level, boolean isShowExpanded, boolean isExpanded, boolean isDataframe, boolean isShowCheckbox, boolean isChecked, boolean isUrl, String imageUrl, boolean isDisabled, boolean isSelected, EsriContextMenuItem[] contextMenuItems
Parameters:
k
node's key
lb
node's label information
lv
node's value
isSE
should the node be able to be expandable in nature.if set to false the node cannot be expanded
isE
Should the node be expanded at the creation time
isSC
should the node be checkable
isC
Is the node checked at the creation time
isU
Whether the node must be rendered as a link.
iU
Url of image to be displayed in toc node
isDi
Whether node is disabled
isS
Whether node is the selected node
mi
Array of adf.ContextMenuItem for this node

addTokenHandler(name, handlerFunction)
This method is used to add the token alongwith with its associated handler function to the Toc

					
					
					
						
							
Parameters:
{String} name
Name of the Token to be added
{Function} handlerFunction
Token Handler Function for the above token

checkedNodeOperation(k, cv)
Sends request to server with params for checkbox operation
Parameters:
{{@link adf.TocNode#key}} k
node's key, this is set by server when adf.TocNode#key is created
{Boolean} cv
checked Value on the client Checked is true , unchecked is false

contextMenuOperation(v, k)
Sends context menu operation params to server
Parameters:
v
ContextMenu item value
k
node's key, this is set by server when adf.TocNode#key is created

init(cont)
Initialize toc control within container specified in the argument
Parameters:
{DOMNode} cont
Toc is rendered to this specified DOM container

nodeOperation(k, o, params)
Sends request to server with node operation specified through a key and its associated operation This can also be specified by params object literal.
var node = new adf.TocNode(10, "n1", 0);
var toc = new adf.Toc("t1",adfdojo.byId("TPanel","mapId");
this.toc.nodeOperation(node.key, "expandCollapse");
Parameters:
{{@link adf.TocNode#key}} k
node's key, this is set by server when adf.TocNode#key is created
{String} o
node operation to be performed through this request at the server
{Object} params
This is a javascript object literal to send additional parameters to the server , it can also be used to send the preceding two argument values too.

updateAsync(xml, eventSources)
Postback tag handler function which is responsible for updating toc control during postback
Parameters:
{XMLNode} xml
XML Response
{Array} eventSources
Array of eventsource names

Documentation generated by JsDoc Toolkit 2.1.0 on Mon May 17 2010 13:45:43 GMT-0700 (PDT)