TREEGEN COMPONENT 4.01
Item Object
Last modified: April 6,1999 
© 2000 Advantys. All rights reserved.

ID

The ID property contains the ID of an item.

Syntax
.ID

Return Values
Returns a Long value which is the ID of the current item.

Examples
<%
Set MyItem = MyTree(3)
Response.Write("ID=" & MyItem.ID)
%>


ChildID

The ChildID property contains the child ID of an item.

Syntax
.ChildID

Return Values
Returns a Long value which is the child ID of the current item.

Examples
The following example checks wether the current item has a child and write its ID if it exists.

<%
Set MyItem = MyTree(3)
if MyItem.HasChild then
Response.Write("ChildID=" & MyItem.ChildID)
end if
%>


SiblingID

The SiblingID property contains the sibling ID of an item.

Syntax
.SiblingID

Return Values
Returns a Long value which is the brother ID of the current item.

Examples
The following example checks wether the current item has a brother and write its ID if it exists.

<%
Set MyItem = MyTree(3)
if MyItem.HasSibling then
Response.Write("SiblingID=" & MyItem.SiblingID)
end if
%>


ParentID

The ParentID property contains the parent ID of an item.

Syntax
.ParentID

Return Values
Returns a Long value which is the parent ID of the current item.

Examples
The following example checks wether the current item has a parent and write its ID if it exists.

<%
Set MyItem = MyTree(3)
if MyItem.HasParent then
Response.Write("ParentID=" & MyItem.ParentID)
end if
%>


Child

The Child property contains the child of the current item.

Syntax
set MyChild = MyItem.Child

Return Values
Returns a Item object which is the child of the current item.

Examples
<%
Set MyItem = MyTree(3)
if MyItem.HasChild then
set MyChild = MyItem.Child
end if
%>


Sibling

The Sibling property contains the brother of the current item.

Syntax
set MyBrother = MyItem.Sibling

Return Values
Returns a Item object which is the brother of the current item.

Examples
<%
Set MyItem = MyTree(3)
if MyItem.HasSibling then
set MySibling = MyItem.Sibling
end if
%>


Link

The Link property contains the link of the current item.

Syntax
set MyLink = MyItem.Link

Return Values
Returns a Link object which is the link of the current item.

Examples
<%
Set MyItem = MyTree(3)
Set MyLink = MyItem.Link
Response.Write("href=" & MyLink.Href)
%>


BackLink

The BackLink property contains the backlink of the current item.

Syntax
set MyLink = MyItem.BackLink

Return Values
Returns a Link object which is the backlink of the current item.

Examples
<%
Set MyItem = MyTree(3)
set MyLink = MyItem.BackLink
Response.Write("href=" & MyLink.Href)
%>


LikeAFolder

The LikeAFolder property checks whether the item looks like a folder.

Syntax
.LikeAFolder

Return Values
Returns a BOOLEAN value that indicates whether the item must look like a folder.

Examples
<%
Set MyItem = MyTree(3)
if MyItem.LikeAFolder then
Response.Write("<IMG SRC='FOLDER.GIF'>")
else
Response.Write("<IMG SRC='ITEM.GIF'>")
end if
%>


ItemDate

The ItemDate property contains a string value.

Syntax
.ItemDate

Return Values
Returns a String object.

Examples
<%
Set MyItem = MyTree(3)
Response.Write("MyDate=" & MyItem.ItemDate)
%>


ShortCut

The ShortCut property contains the shortcut (if it exists) of the item.

Syntax
.ShortCut

Return Values
Returns a String value.

Examples
<%
set MyItem = MyTree(5)
response.write("ShortCut = " & MyItem.ShortCut)
%>


Level

The Level property contains the level of the item.
Level equals to 0 for the root item.

Syntax
.Level

Return Values
Returns a Long value.

Examples
<%
set MyItem = MyTree.RootItem
Response.Write("RootLevel = " & MyItem.Level)
%>


IsChildLoaded

The IsChildLoaded perperty checks whether the current item child is loaded or not.
This function is usefull when you use the loaditems method with a limited deep. If the whole items is not loaded, a specific item may have a child which is not loaded.

Syntax
.IsChildLoaded

Return values
Returns a Boolean value.

Examples
<%
set MyItem = MyTree(5)
if MyItem.IsChildLoaded then
Response.Write(MyItem.Child.link.text & "<br>")
end if
%>


HasChild

The HasChild method checks whether the item has a child.

Syntax
.HasChild()

Return Values
Returns a BOOLEAN value that indicates whether the item has a child. The HasChild method  returns false if there's no child for this item.

Examples
The following example checks wether the current item has a child and writes its ID if it exists.

<%
Set MyItem = MyTree(3)
if MyItem.HasChild then
Response.Write("ChildID=" & MyItem.ChildID)
end if
%>


HasSibling

The HasSibling method checks whether the item has a brother.

Syntax
.HasSibling()

Return Values
Returns a BOOLEAN value that indicates whether the item has a brother. The HasSibling  method returns false if there's no bother for this item.

Examples
The following example checks wether the current item has a brother and writes its ID if it exists.

<%
Set MyItem = MyTree(3)
if MyItem.HasSibling then
Response.Write("SiblingID=" & MyItem.SiblingID)
end if
%>


HasParent

The HasParent method checks whether the item has a parent.

Syntax
.HasParent()

Return Values
Returns a BOOLEAN value that indicates whether the item has a parent. The HasParent  method returns false if there's no parent for this item.

Examples
The following example checks wether the current item has a parent and writes its ID if it exists.

<%
Set MyItem = MyTree(3)
if MyItem.HasParent then
Response.Write("ParentID=" & MyItem.ParentID)
end if
%>


AddChild

The AddChild function adds a child to the current item.

Syntax
set oNewItem = myTree.Items(24).AddChild()

Return values
Returns a Item Object.

Examples
<%
Dim MyTree
Set MyTree = Server.CreateObject("TreeGen.Tree")
Set oNewItem = MyTree.Items.AddChild()
%>


AddSibling

The AddSibling function adds a brother to the current item.

Syntax
set oNewItem = myTree.Items(24).AddSibling()

Return values
Returns a Item Object.

Examples
<%
Dim MyTree
Set MyTree = Server.CreateObject("TreeGen.Tree")
Set oNewItem = MyTree.Items.AddSibling()
%>


© 2000 Advantys. All rights reserved.