WCI Data Tags
Tag jsarraydataformat


This tag is different from other data tag in that it does not set data in a Tag variable. Instead it is used to generate and output a JSON (Javascript object notation) representation of a single- or list of data collections. Data collection properties are represented as javascript object properties, data collection as javascript objects and lists as javascript arrays. Nested lists and collections are supported for use with hierarchical data tags. Used for:1. With menu and tree tag definitions2. Debugging property values in a data collection. Put this tag in an HTML comment or javascript block and pass in the data collection with the properties to inspect. View the values by looking at the HTML source for the page.

Example:
<script>
 var jsdata = <pt:ptdata.jsarraydataformat pt:data="hierdatavar" pt:props="title,url,currpage,img" />;
</script>
Output:
var jsdata = {
 title:'Page 1', url:'http://server/portal/server.pt/community/Community_1', img:'http://imgsrv/img.gif'
 children:[ { title:'Page 1', url:'http://server/portal/server.pt/community/Community_2/page_1', img:'http://imgsrv/img.gif' } ]
 {title:'Page 2', url:'http://server/portal/server.pt/community/Community_2/page_2', img:'http://imgsrv/img.gif'}


Tag Information
Tag Namejsarraydataformat

Attributes
NameTypeRequiredDefault ValueDescription
datastringtruenullReference to tag variable with data to be converted
scopestringfalseportlet requestThe scope of the tag variable referenced in the data attribute.
childkeystringfalsenullHierarchical child key if different from default.
propsstringtruenullA comma separated string with data properties to include in the javascript array.


Copyright 2005 Plumtree Software, Inc.