Welcome Guest Search | Active Topics | Sign In | Register

Treeview duplicating? Options
David Porter
Posted: Tuesday, March 25, 2008 12:24:50 AM
Rank: Advanced Member
Groups: Member

Joined: 6/14/2007
Posts: 36
Hi There,

I recently upgraded from 2007_1_43 to 2007_2_44. I am finding that code that used to work fine with the treeview is now malfunctioning.

I have a custom control which uses an EO tree as a child control within. This tree is built and configured by code and makes use of the populate on demand functionality.

What I am finding is that, since the upgrade, if I click on the "+" icon on my tree, the node does not "expand" and populate on demand. The tree just refreshes with a duplicate.

E.g. I when clicking on the "+" for "item 1" I get:

Root
+ Item 1
+ Item 2
Root
+ Item 1
+ Item 2

Instead of

Root
- Item 1
--- + SubItem A
--- + SubItem B
+ Item 2

However, if I first click on a node title, then click on the "+" icon, then the tree works fine. It is like clicking on the title must initialise "something" which ensure the tree works correctly afterwards.

Some Example Code

Code: Visual Basic.NET
Public Class myTree
    Inherits System.Web.UI.WebControls.WebControl

Private moTreeView As New EO.Web.TreeView
    Private moEOCallback As New EO.Web.Callback
    Private moTableTreeCell As New System.Web.UI.HtmlControls.HtmlTableCell


.....

Protected Overrides Sub OnInit(ByVal e As System.EventArgs)

'set up the treeview here
moTreeView.ID = Me.ID & "_tree"

AddHandler moTreeView.ItemPopulate, AddressOf ItemPopulate


            'add the tree view to the lower cell
            moTableTreeCell.Controls.Add(moTreeView)
            'add the callback, for tracking populate on demand
            moTableTreeCell.Controls.Add(moEOCallback)


.....

    Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)

            'if page first loaded, then build it!
            If Not Page.IsPostBack Then
                bOk = bBuildTree(moTreeView)
            Else
                'bring back the tree... viewstate should maintain tree in this case...
                moTreeView = CType(common.oFindControlRecursive(Page, moTreeView.ID), EO.Web.TreeView)

            End If


Where bBuildTree adds nodes to the tree initially
And ocommon.oFindControlRecursive assigns moTreeView with the existing treeview already existing on the page (so we don't have to rebuild it again)
ItemPopulate is a sub which implements the populate on demand functionality.


My code worked perfectly well before the upgrade. Has anything changed in the new version? Do I need to do anything differently? Please can you advise so I can resolve this issue.

I can supply further information if required. Or if all else fails, I could try and set up a dummy project to emulate this.

Regards,
Dave
eo_support
Posted: Tuesday, March 25, 2008 7:11:24 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,094
Hi Dave,

We are not aware of anything regarding populate on demand has been changed between .43 and .44. The "normal way" to use populate on demand is to build the initial TreeView in Page_Load instead of PreRender, then dynamically populate the through ItemPopulate event. So try that first.

Thanks
David Porter
Posted: Tuesday, March 25, 2008 6:57:18 PM
Rank: Advanced Member
Groups: Member

Joined: 6/14/2007
Posts: 36
Hi,

I tried moving my "build tree" code from "OnPreRender" to "RenderControl" (there is no "Page_Load" for controls). But there was no difference.

I will try to create a simple project to demostrate this issue if I can. I will supply this in a ZIP file if that is acceptable. Please let me know who to send it to.

Regards,
Dave
eo_support
Posted: Tuesday, March 25, 2008 7:00:57 PM
Rank: Administration
Groups: Administration

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

Try to do it in your OnLoad (you will need to override it and call the base class's OnLoad first). We will PM as to where to send your sample code to.

Thanks
David Porter
Posted: Tuesday, March 25, 2008 8:24:44 PM
Rank: Advanced Member
Groups: Member

Joined: 6/14/2007
Posts: 36
Hi,

I tried using onload but the problem remained.

I have created an example web solution and sent the zip through to the email you have specified.

I have found the issue only occurs when the control is put inside an ASP:UpdatePanel.

This issue did not occur with older versions of the EO DLL.

Hope this helps.

Regards,
Dave
David Porter
Posted: Wednesday, March 26, 2008 8:33:34 PM
Rank: Advanced Member
Groups: Member

Joined: 6/14/2007
Posts: 36
Hi,

Please can you let me know if the code i sent through demonstrates the problem, and what sort of timescale there would be for the fix to be released.

Regards,
Dave
eo_support
Posted: Wednesday, March 26, 2008 9:09:53 PM
Rank: Administration
Groups: Administration

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

Sorry about the delay. We have not been able to get to it today but will certainly get to it tomorrow and hopefully we can close the issue tomorrow. Thanks for your patience!

Thanks
David Porter
Posted: Wednesday, March 26, 2008 9:21:59 PM
Rank: Advanced Member
Groups: Member

Joined: 6/14/2007
Posts: 36
Thanks for your quick response :)

I look forward to hearing back soon.

Regards,
Dave
eo_support
Posted: Thursday, March 27, 2008 2:24:31 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,094
Hi Dave,

We have looked into the issue and have fixed it internally and should be able to provide you an update build with the fix soon.

Thanks
eo_support
Posted: Friday, April 4, 2008 7:42:36 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,094
This issue is addressed in build 2007.2.46.
David Porter
Posted: Sunday, April 6, 2008 4:10:59 PM
Rank: Advanced Member
Groups: Member

Joined: 6/14/2007
Posts: 36
Hi There,

Sorry for the delay in reponding.

Just want to thank you for the latest build - it resolved our TreeView issue.

Best Regards,
David
DPRA AUS
Posted: Thursday, April 10, 2008 12:22:08 AM
Rank: Newbie
Groups: Member

Joined: 10/29/2007
Posts: 6
I've got the same problem with populate on demand, but I can't find your 2007.2.46 version? The latest post you have is 2007.2.44. Thanks in advance.
eo_support
Posted: Thursday, April 10, 2008 6:08:49 AM
Rank: Administration
Groups: Administration

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

We've sent you a private message with the download location. You can click the "Inbox" link on top of the forum to view your private messages.

Thanks


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.