Class adf.Toc
Extends
adf.Control.
Defined in: Toc.js.
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 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 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
|
|
checkedNodeOperation(k, cv)
Sends request to server with params for checkbox operation
|
|
contextMenuOperation(v, k)
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
- 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.*
- Default Value:
- true
- Default Value:
- false
- Default Value:
- "TocDiv_adf.Toc#id"
- Default Value:
- adf.TableTocRenderer
- Default Value:
- "}"
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 |
- Default Value:
- "${"
- 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
- Parameters:
- {String} name
- Name of the Token to be added
- {Function} handlerFunction
- Token Handler Function for the above token
- 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
- Parameters:
- v
- ContextMenu item value
- k
- node's key, this is set by server when adf.TocNode#key is created
- Parameters:
- {DOMNode} cont
- Toc is rendered to this specified DOM container
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.
- Parameters:
- {XMLNode} xml
- XML Response
- {Array} eventSources
- Array of eventsource names