Open RadConfirm after postback

2 posts, 0 answers
  1. Raymond
    Raymond avatar
    53 posts
    Member since:
    Aug 2007

    Posted 14 Sep 2009 Link to this post

    I am able to do this with 2009 Q1

     

    string strMessage = "Do you want to add items now?";

     

    JS =

    " Sys.Application.add_init(CRInit);";

     

    JS +=

    " function CRInit(){ Sys.Application.add_load(SRRunOnce);}";

     

    JS +=

    " function SRRunOnce(){ showConfirmation(); Sys.Application.remove_load(SRRunOnce);}";

     

    JS +=

    " function GetRadWindow1(){";

     

    JS +=

    " var oWindow = null;";

     

    JS +=

    " if (window.radWindow) oWindow = window.radWindow;";

     

    JS +=

    " else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;";

     

    JS +=

    " return oWindow;";

     

    JS +=

    "}";

     

    JS +=

    " function showConfirmation(){";

     

    JS +=

    " function CallBackFn(arg){";

     

    JS +=

    " var oWindow = GetRadWindow1();";

     

    JS +=

    " if (arg == 'Yes'){";

     

    JS +=

    " window.location = 'ComponentReworkPackSlipItemDetail.aspx?R=Y&A=A&pid=" + oPackingSlip.PackingSlipReworkId.ToString() + "';";

     

    JS +=

    " }";

     

    JS +=

    " else {";

     

    JS +=

    " oWindow.Close();";

     

    JS +=

    " oWindow.BrowserWindow.refreshGridAndLocate(" + oPackingSlip.PackingSlipReworkId.ToString() + ");";

     

    JS +=

    "}";

     

    JS +=

    "}";

     

    JS +=

    " radconfirm('" + strMessage + "', CallBackFn, 530, 100, null, 'Confirm Add Item');";

     

    JS +=

    "}";

     

     

    ScriptManager.RegisterStartupScript(Page, this.Page.GetType(), key, JS, true);

     

    }


    After user click a button to update to database, the page will prompt user to determine whether add line item now. The above works fine.

    However, when updating to 2009Q2, the code is no longer work with JS error message of "object doesn't support this property or method".

    Please advice how to resolve this.
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 17 Sep 2009 Link to this post

    Hi Raymond,

    I am not quite sure what is causing the problem in your case but the provided code work on my side. I made a little bit changes in thecode - the result of the radconfirm dialog is a Boolean value not a text.
    In this case, could you please rework my test project in order to reproduce the error and send it back? I will check it and do my best to provide a working solution.

    All the best,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top