Creating Nested Bookmarks
Posted: Tue Sep 29, 2009 12:25 pm
Hi all,
I'm relatively new to the product and this forum, but I'm impressed with both. I'm hoping you could help me solve a problem I have creating a tree of nested bookmarks.
My data is flat, meaning the hierarchy I want to display in the bookmark tree can't be created by master-detail databands but rather programatically by myself based on values in the data. I'm basing my code on the example in the documentation about creating bookmarks using code.
In the Bookmark-property of the databand I'm calling a custom function in which I'm doing two things:
- creating the bookmarks using Bookmark.Add(Title1) and Bookmark[Title1].Add(Title2), etc.
- returning the value of Title
This creates the actual bookmark tree with working links, but unfortunately it has an unwanted side effect. It creates the correct hierarchy (i.e. Title1 +--> Title2) but it also creates a separate bookmark node for Title2 on the top level of the bookmark tree. Both the top level and second level nodes take me to the same location in the document, but obviously I would like to hide the top level entry for the bookmark node and only display it on the second level under Title1.
I suspect it has something to do with the return value of my custom function that I call from the Bookmark-property for the databand. I am returning the value for Title, and in the case of Title2 I'm returning the value without the context of Title1. In other words, I'm adding a bookmark on the second level using Bookmark[Title1].Add(Title2) but because I am returning the value of Title2 to the Bookmark-property of the databand, it seems that it creates an entry for Title2 on the top level of the bookmark tree.
What am I doing wrong here? Should I return Title2 in the context of Title1 to the Bookmark-property of the databand somehow? How would I do that?
Thanks!
Rolf
I'm relatively new to the product and this forum, but I'm impressed with both. I'm hoping you could help me solve a problem I have creating a tree of nested bookmarks.
My data is flat, meaning the hierarchy I want to display in the bookmark tree can't be created by master-detail databands but rather programatically by myself based on values in the data. I'm basing my code on the example in the documentation about creating bookmarks using code.
In the Bookmark-property of the databand I'm calling a custom function in which I'm doing two things:
- creating the bookmarks using Bookmark.Add(Title1) and Bookmark[Title1].Add(Title2), etc.
- returning the value of Title
This creates the actual bookmark tree with working links, but unfortunately it has an unwanted side effect. It creates the correct hierarchy (i.e. Title1 +--> Title2) but it also creates a separate bookmark node for Title2 on the top level of the bookmark tree. Both the top level and second level nodes take me to the same location in the document, but obviously I would like to hide the top level entry for the bookmark node and only display it on the second level under Title1.
I suspect it has something to do with the return value of my custom function that I call from the Bookmark-property for the databand. I am returning the value for Title, and in the case of Title2 I'm returning the value without the context of Title1. In other words, I'm adding a bookmark on the second level using Bookmark[Title1].Add(Title2) but because I am returning the value of Title2 to the Bookmark-property of the databand, it seems that it creates an entry for Title2 on the top level of the bookmark tree.
What am I doing wrong here? Should I return Title2 in the context of Title1 to the Bookmark-property of the databand somehow? How would I do that?
Thanks!
Rolf