Welcome Guest Search | Active Topics | Sign In | Register

How to link an object to a TreeNode Options
Roger Jordan
Posted: Thursday, July 18, 2013 6:55:39 AM
Rank: Member
Groups: Member

Joined: 12/29/2008
Posts: 29
Hello,
I like to link an object to an EO.Web.TreeNode element. DataItem is read only. And I need more than a simple string, it's a complex object. Is there any was to do so?
I need the reference to this object when a node is selected.
Best regards,
Roger
eo_support
Posted: Thursday, July 18, 2013 12:04:04 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

You will not be able to do that. The TreeNode object is automatically reconstructed based on view state during post back. Our control would not know how to reconstruct your data object.

Thanks!
Roger Jordan
Posted: Friday, July 19, 2013 2:20:09 PM
Rank: Member
Groups: Member

Joined: 12/29/2008
Posts: 29
There is no need to reconstruct the object. The object is stored in the session state. I only need a way to link it to a node. Example: Each node represents a Mangager inside an organization. I have an object that contains all information about the manager hinself and his organizational unit. So I need something like:
TManager aManager = new TManager("John Doe");
aNode.data = aManager;

Any chance to do so?
eo_support
Posted: Friday, July 19, 2013 2:25:18 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

No. Even if you store your object in session state, we would still need to save and reconstruct a "reference to your object", which again the TreeNode would not know how to do. If you are already saving the object in session state, you can assign each object a unique string id and then let the TreeNode to save/restore that string ID for you. You can then use the string ID to locate your object.

Thanks
Roger Jordan
Posted: Friday, July 19, 2013 2:47:18 PM
Rank: Member
Groups: Member

Joined: 12/29/2008
Posts: 29
OK, thanks for your quick reply!
Have a nice weekend


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.