Welcome Guest Search | Active Topics | Sign In | Register

Treeview callback error Options
SteveClements
Posted: Tuesday, November 25, 2008 6:08:26 AM
Rank: Member
Groups: Member

Joined: 8/28/2008
Posts: 25
I am trying to use the treeview in a webpart, which I plan to use in sharepoint...now I am pretty sure this has worked before but I havent been on the project for 3 months. I am building the treeview in C# and adding the treeview to the control collection.
The ItemClick event in the treeview is being handled, which is used to pass a value to a another webpart.
I have tried the treeview in an ASP.net UpdatePanel, no panel and an EO Callback Panel, none of which perfectly and I get this error...which I dont know how to resolve.
Note: Using the standard asp.net treeview control I get zero errors wrapping it in an updatepanel.


Windows Internet Explorer

EO.Web Controls Client Side Debug Message:



EO.Web control 'ctl00_m_g_f43fe1ba_06a1_428e_98d3_d7a5db99f8f7_ctl01' error message:The callback on 'ctl00_m_g_f43fe1ba_06a1_428e_98d3_d7a5db99f8f7_ctl01'
has failed because the server did not recognize this callback and processed it as a normal request.
This can occur if there are multiple Callback/CallbackPanel controls in the page, and this Callback/CallbackPanel control was initially dynamically
loaded but wasn't loaded for this callback.



This can also occur if you have called Response.Redirect on the server side. Callback/CalbackPanel provides a
Redirect method for such scenario. Please use the Callback/CallbackPanel's Redirect method in this case.(set ClientSideOnError to handle this error).



You can turn off this message by setting EO.Web.Runtime.DebugLevel to 0 (Not recommended for debug build).

OK
---------------------------
eo_support
Posted: Tuesday, November 25, 2008 6:30:53 AM
Rank: Administration
Groups: Administration

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

Do you happen to have changed the ID of the TreeView on the server side? You can check the ClientID of the TreeView on the server side, it should be ''ctl00_m_g_f43fe1ba_06a1_428e_98d3_d7a5db99f8f7'.

Thanks!
SteveClements
Posted: Tuesday, November 25, 2008 6:44:27 AM
Rank: Member
Groups: Member

Joined: 8/28/2008
Posts: 25
int the createChildControls method i do this...

Code: C#
EO.Web.Runtime.DebugLevel = 1;
eoTv = new EO.Web.TreeView();
eoTv.ID = "EOTreeView";
eoTv.ForeColor = System.Drawing.Color.Black;
eoTv.AllowDragDrop = false;
eoTv.CssBlock = "<style type='text/css'>.eoTree{font-size: 11px; cursor: hand; margin-top:-5px;}</style>";
eoTv.CssClass = "eoTree";
                
eoTv.ItemPopulate += new EO.Web.NavigationItemEventHandler(eoTv_ItemPopulate);
eoTv.ItemClick += new EO.Web.NavigationItemEventHandler(eoTv_ItemClick);
eoTv.RaisesServerEvent = true;


I tried commenting out where I set the ID, but it made no difference, I still get the error when the treeview is inside an ASP.net UpdatePanel.

Any ideas?
SteveClements
Posted: Tuesday, November 25, 2008 6:52:46 AM
Rank: Member
Groups: Member

Joined: 8/28/2008
Posts: 25
I have just tried on a vanilla asp.net page, use the same c# code to dynamically build my EO treeview, then put the control into an asp:PlaceHolder's control collection. i.e. No update panels in sight...

I STILL get the same error.
eo_support
Posted: Tuesday, November 25, 2008 7:02:08 AM
Rank: Administration
Groups: Administration

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

Can you create a test page that reproduces the problem? The error message indicates a CallbackPanel because internally the TreeView uses a CallbackPanel control to call your ItemPopulate handler. You can also try to create the TreeView in your Init event handler and see if that works.

Thanks!
SteveClements
Posted: Tuesday, November 25, 2008 7:07:17 AM
Rank: Member
Groups: Member

Joined: 8/28/2008
Posts: 25
I will try the init suggestion.

The problem I have with creating a test page is time...I have a datasource and binding etc that simply cannot be shared. Can you not create a page to duplicated the issue??

This is the second time you have requested my do this, the last one resulted in you releasing a new version.

I wasnt aware I purchased a beta product where I would spend time generating test scenarios for you.

I only really purchased your suite of products was to use the TreeView in Sharepoint.
eo_support
Posted: Tuesday, November 25, 2008 7:30:14 AM
Rank: Administration
Groups: Administration

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

I am really sorry that you felt this way. Unfortunately we are not magicians that can just stare at an error message and instantly tells you a solution. In order for us to precisely pinpoint a problem, we usually need to see the problem and debug through it. Since every user can have a different scenario, without knowing exactly what's going on, we can only shot in the dark. For simple ones this can work, but for complicated ones, a test page is usually needed. Once we have a solution, we also use the test page to verify that it indeed works for you. We believe this is the most straightforward and effective way and it works better than trying this and that back and forth.

We have many users who use our product without any problem. We do have users run into different issues, some times it's an error on our side, or some times the issue can be much better addressed on our side (a feature request, for example), in those case we would usually fix/implement it and send you a new build and our turn around is usually pretty quick.

Thanks
SteveClements
Posted: Tuesday, November 25, 2008 8:14:13 AM
Rank: Member
Groups: Member

Joined: 8/28/2008
Posts: 25
I know exactly what you are saying, a repro is the easiest way for you to resolve the problem.

Apologies if its seemed as though I was venting.

Its just that both times I have tried to use your controls I am back on here spending time creating repro's for problems. I convinced my boss to purchase you controls for not only the improvements but the quality I could develop in half the time, but I spend twice as much time trying to sort things out.

I will try to create a repro, but it really is as simple as I have said...new up a TreeView in code behind, spin through a dataset creating nodes, hook up the itemclicked and ItemPopulate event, drop the control into a place holder.
When I try to expand one of the nodes, i get the error.

I cant be the first person to do this?!
SteveClements
Posted: Wednesday, November 26, 2008 4:12:59 AM
Rank: Member
Groups: Member

Joined: 8/28/2008
Posts: 25
OK, I have created a test page.

Who should I send it too? support[at]essentialobject[dot]com ??
eo_support
Posted: Wednesday, November 26, 2008 7:08:18 AM
Rank: Administration
Groups: Administration

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

We have received the test project and will let you know as soon as we find anything or need anything else.

Thanks!
eo_support
Posted: Wednesday, November 26, 2008 9:32:28 AM
Rank: Administration
Groups: Administration

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

We have looked into the test project. The problem is caused by the code not loading the TreeView again when the page posts back. Consider the event sequence for a page that contains a static TreeView:

1. Page initially loads with the TreeView. Note Page.IsPostBack is false here;
2. User tries to expand a tree node. This causes the page to post back (an AJAX call is actually an HTTP POST);
3. Page loads again with the TreeView. Note Page.IsPostBack is true here;
4. The TreeView noticed the post back is actually an AJAX populate on demand request, it calls its ItemPopulate handler and send the request to the client side properly;
5. The client side code for the TreeView retrieves the child node data and dynamically creates child node;

The key step is step 3, which ensures the TreeView is loaded again when the page posts back, because otherwise there would be no TreeView in the page, thus nobody will be picking up the AJAX request and handle it properly.

This is usually not a problem when the TreeView is statically placed in .aspx file because when used that way, the TreeView is always there regardless whether the page is intially loaded or posted back; This is not the case when you load the TreeView dynamically by code. If you load the TreeView initially but does not load it during post back, the TreeView won't be there to handle the AJAX populate on demand request.

You can modify your Page_Load to something like this:

Code: C#
string mode = null;
if (!IsPostBack)
{
    BuildTreeViewThatIsDeclarativelyOnPage(worksiteMoniker);

    //Get mode from query string and save it to view state
    mode = Request.QueryString["mode"];
    ViewState["LastMode"] = mode;
}
else
{
    //Get last mode from view state
    mode = (string)ViewState["LastMode"];
}

//ALWAYS load the treeview based on the current/last mode....
.......


This should resolve the issue for you.

Thanks
SteveClements
Posted: Thursday, November 27, 2008 1:50:31 AM
Rank: Member
Groups: Member

Joined: 8/28/2008
Posts: 25
Maybe its just me but I have the same problem.

Running this still causes the problem, when stepping through, the treeview is built on postback and the ItemPopulate event fires and runs fine, but the callback error still pops up.

Code: C#
if (!IsPostBack)
        {
            

            if (!String.IsNullOrEmpty(Request.QueryString["mode"]))
            {
                mode = Request.QueryString["mode"];
            }
            else
            {
                mode = "none";
            }
            ViewState["LastMode"] = mode;
        }
        else
        {
            mode = ViewState["LastMode"].ToString();
        }

        switch (mode)
        {
            case "none":
                lblWhat.Text = "TreeView Loaded not wrapped in any panel";
                NoAjax();
                break;
            case "asp":
                lblWhat.Text = "TreeView Loaded wrapped in ASP.NET AJAX Update Panel";
                AspAjax();
                break;
            case "eo":
                lblWhat.Text = "TreeView Loaded wrapped in EO Callback panel";
                EoCallback();
                break;
            default: break;
        }


This was perhaps a poor repro, in the wild its being used in a webpart, the same code runs, but in the createchildcontrols method...with no mention of the IsPostback flag.
eo_support
Posted: Thursday, November 27, 2008 4:56:46 AM
Rank: Administration
Groups: Administration

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

What version are you running? We did try the same code and it worked fine. So you might have an old build with such issues but is already fixed in the new build.

Or maybe we did not get the correct steps to reproduce the problem ---- we simply click the tree node to causes server side item click event and click the plus sign to cause the server side item populate event. Please let us know if your steps are different.

Thanks
SteveClements
Posted: Thursday, November 27, 2008 5:17:27 AM
Rank: Member
Groups: Member

Joined: 8/28/2008
Posts: 25
I am using version 36.2

Clicking on the plus sign is what gives me the issue ( i generally click on the second one down (M)) but it does matter.

I have tried different browsers as well.

I should also add: I can debug the code and both item click and item populate event are hooked up and working fine. THe error comes after.
eo_support
Posted: Thursday, November 27, 2008 5:51:29 AM
Rank: Administration
Groups: Administration

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

Try the latest build first. That seems to be the only difference.

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.