This is a migrated thread and some comments may be shown as answers.

Fire fox problem

14 Answers 74 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Rishi
Top achievements
Rank 1
Rishi asked on 22 Aug 2008, 12:01 PM

in fire fox when i click a node then the tree get collasped (Actually page get post back) Its working fine in IE.


i have also written AfterClientClick handler

and from this handler i am  trying to refresh an update panel present on the page.
My tree view is outside the update panel.

my Handler Code is

function AfterClickHandler(node)

{

if(node.Level >3)
{
var HdnVal = document.getElementById('<%=HdnValue.ClientID %>');

HdnVal.value = node.Value;

document.getElementById(

'<%=btnRefresh.ClientID %>').click();

}

}

14 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 25 Aug 2008, 07:40 AM
Hi Rishi,

Please answer our questions in Ticket ID: 155745.

All the best,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rishi
Top achievements
Rank 1
answered on 25 Aug 2008, 08:15 AM
Hello Paul,

The controls are not downloaded  under my account.

Actually our company Graycell Technoligies Exports is registered at ur site

It may under our C.E.O account
U can check for his account.
His Name is Munish and Id is munish@graycelltech.com 



Thanks n Regards
Rishi Kasnia
(Graycell Technologies Exports)
0
Atanas Korchev
Telerik team
answered on 25 Aug 2008, 11:35 AM
Hello Rishi,

Thanks for the clarification. We will reply on the matter in the support ticket.

Now up to your initial question. You can configure the treeview to be a trigger for the update panel and cancel the postback for all nodes except the 4 level ones. Please find attached a sample project.

Best wishes,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rishi
Top achievements
Rank 1
answered on 25 Aug 2008, 12:15 PM

ThankYou for your Reply.


Actually i dont want to post back on click at any Node.


I only want  is that When user click on Leaf Node(In My case Level 4)
The Update panel should show some Information corresponding to the node Clicked (Only leaf ) and this should achived through AJAX not by the Page POST BACKS and for this i am using Update Pannel .

I have achived this through Java .  

( I have used a hidden Field and a Button Control and have registered the click event of this Button Control with triggeres in Update Pannel  Now when user Click on Leaf Node then By Using the AfterClientClick handler i check the Depth of Node If the dept is greater than 4 then i  Fires the Click Event of button and also set the ID  stored in node to a hidden Field . By this the Update panel Updates the Data List on the panel)

JAVA SCRIPT FUNCTION :-

function AfterClickHandler(node)

{

if(node.Level>3)

{

var HdnVal = document.getElementById('<%=HdnValue.ClientID %>');

HdnVal.value = node.Value;

// here the ID of node is set to the hidden field so that i can access this ID on my .CS File of this page

 

document.getElementById(

'<%=btnRefresh.ClientID %>').click(); // CLick Event Fired so that the Update Pannel    Updates the Data List placed on the Update Pannel

}

}


TRIGGER REGISTERED:-

<Triggers>

 

<asp:AsyncPostBackTrigger ControlID="btnRefresh" EventName="Click" /> 

//Here the Triggere for my Button Control is Registered

</Triggers>




CODE PART OF MY .CS File:-


protected void btnRefresh_Click(object sender, EventArgs e)

{

tblMngFolder.Visible =

false;

tblRssRead.Visible =

true;

// the vale set by java script function to hidden field is accessed here
Int32 RSS_Id = Convert.ToInt32(HdnValue.Value);


// this function Binds the Data List so that the information according to the node clicked Displayed
LoadThisControl(
Convert.ToInt32(RSS_Id), (Guid)Session["Uid"]);

}

Hoping this Explanation will help you to figure out the problem....



 Its Working Fine in I.E. but in  FireFox when i click the Leaf Node the whole  Tree Get Collasped (Because it generates the complete PostBack.).....



Thanks n Regards
Rishi
(Graycell Technologies Exports)

0
Atanas Korchev
Telerik team
answered on 25 Aug 2008, 12:23 PM
Hi Rishi,

Clicking the button still initiates a postback as well as the treeview. I don't see what the difference is. Actually using the treeview is more straight forward and easy approach and works in both IE and FireFox.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rishi
Top achievements
Rank 1
answered on 25 Aug 2008, 12:58 PM
But Albert by this way i access the Button_Click() event on the server side code and in this code i can track the node clicked at client side by the use of hidden field which was set in the AfterClientClickHandler.

With the Tree View how can i  track at the server side code, that which node was clicked  (and i dont want a complete postback). Will u please tell me in this situation which event of treeview will be avaliable for me at serverside.




Thanks n Regards
Rishi
(Graycell Technologies Exports)
0
Atanas Korchev
Telerik team
answered on 25 Aug 2008, 01:01 PM
Hello Rishi,

You can use the NodeClick event as demonstrated in the sample application. In the event args you can access the clicked node.

Sincerely yours,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rishi
Top achievements
Rank 1
answered on 25 Aug 2008, 01:29 PM
Thanks Albert for your valuable suggestion.


But i  am using two content place holders on my Page (As i mentioned in my First Post)

My tree View is on First Content Place holder and the Update Panel is on Second Content Place Holder so  i think  i can not Register the event for a treeview on a Content Place Holder  with the  trigger of a Update Pannel which is on another Content Place Holder.


I have done and Getting this Error 

A control with ID 'rtreeNavigation' could not be found for the trigger in UpdatePanel 'updRssFeed'.


Exception Details: System.InvalidOperationException: A control with ID 'rtreeNavigation' could not be found for the trigger in UpdatePanel 'updRssFeed'.

Thanks n Regards
Rishi
(Graycell Technologies Exports)
0
Atanas Korchev
Telerik team
answered on 25 Aug 2008, 02:28 PM
Hello Rishi,

I have updated the sample web site to use master page and content placeholders.

Kind regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rishi
Top achievements
Rank 1
answered on 26 Aug 2008, 04:54 AM

Albert don't  we need to define the event name while adding the trigger.

You have't added the event for RadTreeView.


protected void Page_Init(object sender, EventArgs e)

{

AsyncPostBackTrigger trigger = new AsyncPostBackTrigger();

trigger.ControlID = rtreeNavigation.UniqueID;

// trigger.EventName = rtreeNavigation.BeforeClientClick;

updRssFeed.Triggers.Add(trigger);

}

0
Rishi
Top achievements
Rank 1
answered on 26 Aug 2008, 06:41 AM
Sorry  Albert,

I Know this time it is not logical Question but this is not working in my project.

i have seen ur sample demo project its working fine there.

but in my case the Update Pannel is not getting updated. Only Javascript handler BeforeClick()  fired.

i have declared the ExpandeMode property to Server Side Call back only for parents node not for the leaf.   Is this can be a reason. 
0
Atanas Korchev
Telerik team
answered on 26 Aug 2008, 06:44 AM
Hello Rishi,

Are you using load on demand?

All the best,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rishi
Top achievements
Rank 1
answered on 26 Aug 2008, 07:00 AM
Yes Albert,
On TreeView_NodeExpand() event i add the child nodes based on the DataBase values.
0
Atanas Korchev
Telerik team
answered on 26 Aug 2008, 07:14 AM
Hello Rishi,

This has been never mentioned before. Unfortunately the solution I was proposing won't work in this case. Load on demand nodes do not support postback hence cannot be ajaxified. I am afraid I don't know any other way how to trigger programmatically the update of an ajax panel which is cross browser compatible. You may have to revert to the old workaround (with the button) and try to make it work in FireFox. Alternatively you can try with a link button.

The other option is to use RadAjaxPanel or RadAjaxManager which have clean API for triggering ajax request from the client-side.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Rishi
Top achievements
Rank 1
Answers by
Paul
Telerik team
Rishi
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or