|
Rank: Advanced Member Groups: Member
Joined: 4/22/2008 Posts: 75
|
I am using 2 Callback Panels with the Group option. Callback panel 1 is a search form that gets filled out and it build a TreeView object and then dump the HTML to an ASP Literal in callback pabel 2. This is donw because they are inside of a splitter object. The code without the callback panels works fine but with them i get a JS Client side error. I have even made a quick sample page for debuging and will post the code after this post. Now all i did for the sample is take the HTMl string that my control dumps and hardcoded it to a variable and then load the Literal form the tree view instead of directly from the control. Please help me find the issue because it says my JS variable for the ID is not set but it is clearly in the first line of code.
Thank You.
|
|
Rank: Advanced Member Groups: Member
Joined: 4/22/2008 Posts: 75
|
ASPX CODE
Code: HTML/ASPX
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Administrators_Default" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
<eo:CallbackPanel ID="CallbackPanel1" runat="server" Height="150px" Width="200px" GroupName="grp1">
<asp:Literal ID="litTreeView" runat="server"></asp:Literal>
</eo:CallbackPanel>
</td>
<td>
<eo:CallbackPanel ID="CallbackPanel2" runat="server" Height="150px" Width="200px" GroupName="grp1" Triggers="{ControlID:btnLoad;Parameter:}">
<asp:Button ID="btnLoad" runat="server" Text="LoadTreeView" />
</eo:CallbackPanel>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
|
|
Rank: Advanced Member Groups: Member
Joined: 4/22/2008 Posts: 75
|
VB>NET CODE BEHIND
Code: Visual Basic.NET
Partial Class Administrators_Default
Inherits System.Web.UI.Page
Private strTree As String = ""
Protected Sub btnLoad_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLoad.Click
loadTreeViewString()
litTreeView.Text = strTree
End Sub
Private Sub loadTreeViewString()
' THIS IS A COPY AND PAST OF THE HTML STRING
' THAT GET DUMPED OUT BY THE CUSTOMER TREEVIEW CONTROL
' THAT WE ARE USING> NOTE: THIS IS NOT AN EO TREE VIEW
strTree = "" & _
"<!-- ASP TreeView component version 2.0.38 www.obout.com (.NET dll) -->" & _
"" & _
"<link rel=""stylesheet"" href=""styles/tree2/style/classic/obout_treeview2.css"" />" & _
"<script type=""text/javascript"" language=""JavaScript"">var ob_tree_id=""SearchTree"";verdadero=true;falso=false;wahr=true;falsch=false;vrai=true;faux=false;var ob_icons=""styles/tree2/icons"";var ob_style=""styles/tree2/style/classic"";ob_select_on_collapse=true;ob_tree_dnd_enable=false;ob_tree_editnode_enable=false;ob_tree_keynav_enable=false;ob_tree_multiselect_enable=false;ob_expand_single=false;ob_t2_showicons=true;</script><script language=""JavaScript"" type=""text/javascript"" src=""styles/tree2/script/ob_tree_2038.js""></script><script language=""JavaScript"" type=""text/javascript"" src=""styles/tree2/script/ob_events_2038.js""></script>" & _
"<div id=""SearchTree"" class=""ob_tree"" style=""overflow:visible;""><div class=""ob_di2""><div class=""ob_d2b""><table class=""ob_t2b"" cellspacing=""0"" style=""display:block;""><tr><td class=""ob_t8"" style=""display:none;""><img alt="""" src=""styles/tree2/style/classic/minus_r.gif"" onclick=""ob_t21(this, '')"" /></td><td class=""ob_t4""><div class=""ob_d4""><img alt="""" src=""styles/tree2/icons/oSearch.gif"" /></div></td><td id=""root_SearchTree"" onclick=""ob_t22(this, event)"" class=""ob_t2"" valign=""middle""><b>Affiliate Search Results</b><br> (2 records returned)</td></tr></table><table class=""ob_t2c"" cellspacing=""0"" style=""display:block;""><tr><td><div class=""ob_d5""></div></td><td class=""ob_t5""><div class=""ob_d2c""><table class=""ob_t2g"" cellspacing=""0""><tr><td class=""ob_t6v""><img alt="""" src=""styles/tree2/style/classic/hr.gif"" /></td><td class=""ob_t4""><div class=""ob_d4""><img alt="""" src=""styles/tree2/icons/person.gif"" /></div></td><td id=""1"" onclick=""ob_t22(this, event)"" class=""ob_t2""><span style='cursor:pointer;color:blue'onclick=""spBody.loadPage('RightContent','EMS_AffiliateDisplay.aspx?AID=+F/Q+yVTtQE=&LID=+F/Q+yVTtQE=&SESID=J9I0YkbMJz4+McHEybS8Mw==');""><b><u>Admin, Sys (1)</u></b><br>DO NOT MODIFY OR DELETE THIS AFFILIATE.<br><br><br></span></td></tr></table></div><div class=""ob_d2c""><table class=""ob_t2g"" cellspacing=""0""><tr><td class=""ob_t6""><img alt="""" src=""styles/tree2/style/classic/hr_l.gif"" /></td><td class=""ob_t4""><div class=""ob_d4""><img alt="""" src=""styles/tree2/icons/person.gif"" /></div></td><td id=""132"" onclick=""ob_t22(this, event)"" class=""ob_t2""><span style='cursor:pointer;color:blue'onclick=""spBody.loadPage('RightContent','EMS_AffiliateDisplay.aspx?AID=PbCc2hxfuRQ=&LID=+F/Q+yVTtQE=&SESID=J9I0YkbMJz4+McHEybS8Mw==');""><b><u>Food & Drug Administration CDER (132)</u></b><br>301-827-7303<br>7520 Standish Place, Room 200<br>Rockville, MD 20855<br><br></span></td></tr></table></div></td></tr></table></div></div></div><script type=""text/javascript"" language=""JavaScript"">var ob_noedit='';ob_KeepLastExpanded=0;ob_KeepLastCollapsed=0;var sNoSelect='';var ob_eventFlags={""OnSomeEvent"":true};function getStyle(oElm,strCssRule){var strValue="""";if(document.defaultView && document.defaultView.getComputedStyle){strValue=document.defaultView.getComputedStyle(oElm,"""").getPropertyValue(strCssRule);}else if(oElm.currentStyle){try{strCssRule=strCssRule.replace(/\-(\w)/g, function (strMatch,p1){return p1.toUpperCase();});strValue=oElm.currentStyle[strCssRule];}catch(ex){}}return strValue;};function ob_RootNode(){var rt=document.getElementById(ob_tree_id).firstChild.firstChild.firstChild;var ct=rt.nextSibling;if(ct==null){return;}var c=ct.firstChild.firstChild.firstChild;var it=rt.firstChild.firstChild.firstChild;var sIS="""";var sRS="""";try{sIS=getStyle(it,""display"");}catch(ex){sIS=""none"";}try{sRS=getStyle(rt,""display"");}catch(ex){sRS=""none"";} if(ct!=null&&(sRS==""none""||sIS==""none"")){ if(navigator.userAgent.toLowerCase().indexOf(""firefox"")==-1) {c.style.display=""none"";}else{c.style.width=""1px"";c.firstChild.style.display=""none"";}}}ob_RootNode();function ob_initTree(i){if((typeof(ob_tree_js_version)==""undefined"")||(ob_tree_js_version!=""2038"")){if(i<30){window.setTimeout(""ob_initTree(""+(i+1)+"")"",900);}else{if(confirm(""ASP.NET Treeview version 2.0.38\n \nClick OK to generate correct paths.\nTreeview will work fine with correct paths.\n"")){window.location=""http://www.obout.com/t2/ht_Path.aspx"";}}return;}else{ob_t26("""");}}ob_initTree(0);</script>" & _
"" & _
"<!-- ASP TreeView component version 2.0.38 www.obout.com (.NET dll) -->"
End Sub
End Class
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You probably don't want to mix our controls with obout's. :) It's not to say that they are no good, but you can reasonable assume that our CallbackPanel works with our own TreeView better. I believe the same goes true for them.
CallbackPanel runs JavaScript inside a local scope, not the global scope. So if the JavaScript rendered through CallbackPanel is not prepared of that, it may fail. In another word, the control (obout TreeView in this case) to be AJAXed needs to be AJAX-ready. Unfortunately, 100% AJAX-ready is not possible because there are many AJAX solutions, and a control that runs fine on this AJAX solution may not work on that AJAX solution. For example, we support our own AJAX solution and ASP.NET AJAX, but we do not support other third party AJAX solution such as AJAXPro. In case a control does not support our AJAX solution, there isn't much we can do because they will have to change code on their side in order to make it work.
Two possible workaround for you are: 1. Replace our CallbackPanel with ASP.NET AJAX UpdatePanel. This may or may not solve the problem for you. I expect it to work because ASP.NET AJAX is from MS, so not supporting it would be a major problem for them; 2. Replace their TreeView with our TreeView. Our TreeView works with our CallbackPanel fine;
Hope this helps.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 4/22/2008 Posts: 75
|
The original reason we went to the obout treeView is i made a page and loaded the same data into both treeview and yours was VERY slow comapred to there.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
In that case you may want to try to use theirs with ASP.NET AJAX. I would expect theirs to support ASP.NET AJAX.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 4/22/2008 Posts: 75
|
Well im not doing ti for the AJAX but the Loading Message I use a Splitter and in the right side is a search form and when filled out and click search it build a TreeView in the background and then loads the tree view in the left Panel but with thousands of records it can look likes it does when the frame is still loading so i wanted to do a loading message and your callback panel with the dialog works like a charm
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Loren wrote:your callback panel with the dialog works like a charm But you are running into the JavaScript issue. :) In this case there is nothing we can do because the JavaScript code that causes the error is from somebody else, not us, and we can't just grab their code and change it. So if you really do not want to change your own code, you will want to contact obout --- they may tell you the same thing to switch to ASP.NET AJAX, or they can find out exactly where and why their code fails and provide you a fix.
|
|