Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
ultrawebtree does not cancel postback
posted

When I run this app and click on a node, a prompt asks me if I want to continue.  If I click on 'Cancel', the POSTBACK stops as intended.  If I click on 'OK', the POSTBACK continues as it should.  However, once if I click on any nodes and I try cancelling the POSTBACK by clicking on 'Cancel', the POSTBACK continues!!  Why?  What am I doing wrong in this app??  Thanks for your help.

See app below:

 

<% 

 @ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestUltraWebTree._Default" %>

<% 

@ Register Assembly="Infragistics35.WebUI.UltraWebNavigator.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebNavigator" tagprefix="ignav" %>

<%

@ Register Assembly="Infragistics35.Web.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.LayoutControls" TagPrefix="ig" %>

 

 

 

<! 

 

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>test app</title>

 

<script type="text/javascript">

  

 

function tvwDevices_BeforeNodeSelectionChange() {

 

var changesMade = 'true' ;

 

if (changesMade == 'true' ) {var confirmLeave = window.confirm("You have unsaved changes. \n \n Are you sure you want to continue?"

 

 

 

 

 

 );

 

if (confirmLeave) {

 

//parent.needtoSave(false);

 

 

else

}

 

 

{

 

//parent.needtoSave(true);

 

 

return true;

 

//true cancels postback

}

}

}

 

 

 

 

</script >

</ head >

<

 

body >

 

 

 

<form id="form1" runat ="server">

 

 

<div >

 

<asp:ScriptManager ID="ScriptManager1" runat ="server"> </asp:ScriptManager >

 

</div >

 

div id="splitterDIV" style ="width: 100%; height: 750px;">

 <

 

<ig:WebSplitter ID="WebSplitter1" runat="server" Width="100%" Height ="100%">

 

 

<Panes >

 

 

<ig:SplitterPane Size="250px" CollapsedDirection ="PreviousPane">

 

 

<Template >

 

<ignav:UltraWebTree ID="tvwDevices" runat="server" DefaultImage="" HoverClass="" Indentation="5" Width ="140px">

 

 

<AutoPostBackFlags NodeChanged="True" NodeChecked="False" NodeCollapsed="False"  

 

NodeDropped="False" NodeExpanded="False" />

 

<ClientSideEvents BeforeNodeSelectionChange="tvwDevices_BeforeNodeSelectionChange" />

 

 

<Levels >

 

 

<ignav:Level Index="0" />

 

 

<ignav:Level Index="1" />

 

 

</Levels >

 

 

<Nodes >

 

 

<ignav:Node Text ="Root Node">

 

 

<Nodes >

 

 

<ignav:Node Text="Yahoo" TargetUrl="http://www.yahoo.com" TargetFrame ="_content">

 

 

</ignav:Node >

 

 

<ignav:Node Text="Google" TargetUrl="http://www.Google.com" TargetFrame="_content">

 

 

</ignav:Node >

 

 

<ignav:Node Text="bing" TargetUrl="http://www.bing.com" TargetFrame="_content">

 

 

</ignav:Node >

 

 

<ignav:Node Text="dog pile" TargetUrl="http://www.dogpile.com" TargetFrame="_content">

 

 

</ignav:Node > 

 

</Nodes >

 

</ignav:Node >

 

 

</Nodes >

 

 

</ignav:UltraWebTree >

 

</Template >

 

</ig:SplitterPane >

 

 

<ig:SplitterPane >

 

 

<Template >

 

 

<iframe name="_content" style ="width: 100%; height: 100%; border: none 0px; margin: 0px; padding: 0px;" frameborder="0" >

 

</iframe >

 

 

</Template >

 

 

</ig:SplitterPane >

 

</Panes >

  

</ig:WebSplitter >

 

</div>

 

</form >

</

 

body >

</

 

 html >

 

 

 

Parents
No Data
Reply
  • 49378
    posted

    Hi mrjdavilla,

    I know it has been a while since your post but in case you are still in need of assistance I would be glad to help.

    I investigated your scenario but was unable to spot any issues with your implementation. Here is the slightly modified javascript function I used:

    function tvwDevices_BeforeNodeSelectionChange() {
            var changesMade = 'true' ;
            if (changesMade == 'true' ) {var confirmLeave = window.confirm("You have unsaved changes. \n \n Are you sure you want to continue?"); }

            if (confirmLeave) {

            return false;
           }

            return true;

    }

    Please do not hesitate to contact me if you have any questions.

    Best Regards,

    Petar Ivanov
    Developer Support Engineer
    Infragistics, Inc.
    http://es.infragistics.com/support

Children
No Data