KNOCK OUT ISSUES IN EDIT MODE.

50 views
Skip to first unread message

sriram.ra...@gmail.com

unread,
Jul 3, 2014, 1:41:01 PM7/3/14
to knock...@googlegroups.com
Dear all,

I have a serious issue with knockout js using in ASP.NET.

I  have a page where i am using for  insertion and updated for the data. So while i am reaching that  page from  search page by clicking the EDIT link in the search grid.
so some times the drop down values are not setting up to edit values.Some times it's stetting up in right way.i did this exercise for 10 times(3 times drop down values setting up right way.) Please try to help me out.



Here is my code.
/// <reference path="jquery-2.0.3.min.js" />
/// <reference path="knockout-3.1.0.js" />
/// <reference path="json2.js" />

var vBuidPK = -1;

function GetEmptyUBRAM() {

    var varlcd = [{ BURAMIdPK: 0, BUIDFK: 0, Asof: "", CRMP: "", Underwriting: "", RiskMonitoring: "",
        RiskIdentification: "", Criticizedassetsmgmt: "", LevelofRisk: "", TrendofRisk: "",
        Processdesing: "", ProcessEffective: "", Comments: "", QAComments: "", EPMID: "", EPMStatus: "", CCEID: "",
        CCEStatus: "", CCEComments: "", IsProcessStart: false, CreatedBy: "", CreatedDate: "", LastModifiedBy: "", LastModifiedDate: "",
        EMPModified: "", CCEModified: "", Created: ""
    }
    ];
    return varlcd;
}
function tblUBRAMDetails(data) {
    this.BURAMIdPK = ko.observable(data.BURAMIdPK)
    this.BUIDFK = ko.observable(data.BUIDFK)
    this.Asof = ko.observable(data.Asof)
    this.CRMP = ko.observable(data.CRMP)
    this.Underwriting = ko.observable(data.Underwriting)
    this.RiskMonitoring = ko.observable(data.RiskMonitoring)
    this.RiskIdentification = ko.observable(data.RiskIdentification)
    this.Criticizedassetsmgmt = ko.observable(data.Criticizedassetsmgmt)
    this.LevelofRisk = ko.observable(data.LevelofRisk)
    this.TrendofRisk = ko.observable(data.TrendofRisk)
    this.Processdesing = ko.observable(data.Processdesing)
    this.ProcessEffective = ko.observable(data.ProcessEffective)
    this.Comments = ko.observable(data.Comments);
    this.QAComments = ko.observable(data.QAComments)
    this.EPMID = ko.observable(data.EPMID)
    this.EPMStatus = ko.observable(data.EPMStatus)
    this.CCEID = ko.observable(data.CCEID)
    this.CCEStatus = ko.observable(data.CCEStatus)
    this.CCEComments = ko.observable(data.CCEComments)
    this.IsProcessStart = ko.observable(data.IsProcessStart)
    this.CreatedBy = ko.observable(data.CreatedBy)
    this.CreatedDate = ko.observable(data.CreatedDate)
    this.LastModifiedBy = ko.observable(data.LastModifiedBy)
    this.LastModifiedDate = ko.observable(data.LastModifiedDate)
    this.EMPModified = ko.observable(data.EMPModified)
    this.CCEModified = ko.observable(data.CCEModified)
    this.Created = ko.observable(data.Created)
}


function BURAMVIEW() {
    var tabs = $("#tabs").tabs({
        select: function (e, i) {
            selected_tab = i.index;
        }
    });
    var self = this;
    self.BuRAMs = ko.observableArray();
    self.CRMP = ko.observableArray();
    self.UNDER = ko.observableArray();
    self.RM = ko.observableArray();
    self.RID = ko.observableArray();
    self.CRTICIZED = ko.observableArray();
    self.PROCESSDESIGN = ko.observableArray();
    self.PROCESSEFFECT = ko.observableArray();
    self.GETUBRAMDTLS = ko.observableArray([]);


    self.LEVELOFRISK = ko.observableArray();
    self.TRENDOFRISK = ko.observableArray();
    self.EPMSTATUS = ko.observableArray();
    self.CCESTATUS = ko.observableArray();
    self.TRENDOFRISK = ko.observableArray();
    self.LEVELOFRISK = ko.observableArray();
    self.MANGERS = ko.observableArray();

    //For control flow.
    self.LOGINID = ko.observable();
    self.LOGINROLEID = ko.observable();


    this.LoadInitalData = function () {

        $.ajax({
            type: "POST",
            data: {},
            url: "../BURAMPages/CreateEditUBBURAM.aspx/GetAllBusinessUnit",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                if (response != "") {
                    self.BuRAMs(response.d);
                }
            }
        });
        $.ajax({
            type: "POST",
            data: ko.toJSON({ scode: "CH6" }),
            url: "../AQReviewPages/LineCard.aspx/GetAllDivisions",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                if (response != "") {
                    self.CRMP(response.d);
                    self.UNDER(response.d);
                    self.RM(response.d);
                    self.RID(response.d);
                    self.CRTICIZED(response.d);
                    self.PROCESSDESIGN(response.d);
                    self.PROCESSEFFECT(response.d);
                }
            }
        });
        $.ajax({
            type: "POST",
            data: ko.toJSON({ scode: "CH36" }),
            url: "../AQReviewPages/LineCard.aspx/GetAllDivisions",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                if (response != "") {
                    self.LEVELOFRISK(response.d);
                }
            }
        });
        $.ajax({
            type: "POST",
            data: ko.toJSON({ scode: "CH7" }),
            url: "../AQReviewPages/LineCard.aspx/GetAllDivisions",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                if (response != "") {
                    self.TRENDOFRISK(response.d);
                }
            }
        });
        $.ajax({
            type: "POST",
            data: {},
            url: "../BURAMPages/CreateEditUBBURAM.aspx/GetAllMangerList",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                if (response != "") {
                    self.MANGERS(response.d);
                }
            }
        });

        $.ajax({
            type: "POST",
            data: ko.toJSON({ scode: "CH46" }),
            url: "../AQReviewPages/LineCard.aspx/GetAllDivisions",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                if (response != "") {
                    self.EPMSTATUS(response.d);
                    self.CCESTATUS(response.d);
                }
            }
        });
    }

    this.LoginDetails = function () {
        $.ajax({
            type: "POST",
            data: {},
            url: "../BURAMPages/CreateEditUBBURAM.aspx/GetLoginDetails",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                if (response != "") {
                    self.LOGINID(response.d[0].UserPK);
                    self.LOGINROLEID(response.d[0].LoginUserRoleId);
                    self.GetControlFlow(0);
                }
            }
        });
    }

    //Adding empty values for the first time
    self.GETUBRAMDTLS(GetEmptyUBRAM());
    this.EditUBDetails = function () {
        GetUBBURAMDtlsByID(vBuidPK);
    }
    this.GetControlFlow = function (vEMPID) {
        //For Examiners...
        if (self.LOGINROLEID() == 6 && self.LOGINID() != vEMPID) {
            $("#ddlepm").prop("disabled", true);
            $("#ddlepmstatus").prop("disabled", true);
            $("#ddlccestatus").prop("disabled", true);
        }
        //For CCE
        else if (self.LOGINROLEID() == 5) {
            $("#ddlepm").prop("disabled", true);
            $("#ddlepmstatus").prop("disabled", true);
            $("#ddlccestatus").prop("disabled", false);
        }
        //For Admin
        else if (self.LOGINROLEID() == 1) {
            $("#ddlepm").prop("disabled", false);
            $("#ddlepmstatus").prop("disabled", false);
            $("#ddlccestatus").prop("disabled", false);
        }
        else if (vEMPID > 0 && self.LOGINID() == vEMPID) {
            $("#ddlepm").prop("disabled", true);
            $("#ddlepmstatus").prop("disabled", false);
            $("#ddlccestatus").prop("disabled", true);
        }
        else if (self.LOGINROLEID() == 3) {
            $("#ddlepm").prop("disabled", true);
            $("#ddlepmstatus").prop("disabled", false);
            $("#ddlccestatus").prop("disabled", true);
        }

        if (self.LOGINROLEID() == 6 && self.GETUBRAMDTLS()[0].IsProcessStart == true && vEMPID == 0) {
            $("#txtcomments").attr('disabled', true);
            $("#txtQAcomments").attr('disabled', true);
            $("#txtccecomments").attr('disabled', true);
        }

        else if (self.LOGINROLEID() == 6 && self.GETUBRAMDTLS()[0].IsProcessStart == false && vEMPID == 0) {
            $("#txtcomments").attr('disabled', false);
            $("#txtQAcomments").attr('disabled', true);
            $("#txtccecomments").attr('disabled', true);
        }
        else if (vEMPID > 0 && self.LOGINID() == vEMPID) {
            $("#txtcomments").attr('disabled', false);
            $("#txtQAcomments").attr('disabled', true);
            $("#txtccecomments").attr('disabled', true);
        }
        else if (self.LOGINROLEID() == 3) {
            $("#txtcomments").attr('disabled', false);
            $("#txtQAcomments").attr('disabled', true);
            $("#txtccecomments").attr('disabled', true);
        }
        else if (self.LOGINROLEID() == 5) {
            $("#txtcomments").attr('disabled', true);
            $("#txtQAcomments").attr('disabled', true);
            $("#txtccecomments").attr('disabled', false);
        }
        else if (self.LOGINROLEID() == 1) {
            $("#txtcomments").attr('disabled', false);
            $("#txtQAcomments").attr('disabled', false);
            $("#txtccecomments").attr('disabled', false);
        }
        else if (vEMPID > 0) {
            if (self.LOGINROLEID() == 6 && self.GETUBRAMDTLS()[0].IsProcessStart() == true) {
                $("#txtcomments").attr('disabled', true);
                $("#txtQAcomments").attr('disabled', true);
                $("#txtccecomments").attr('disabled', true);
                $("#chksubmit").attr('disabled', true);
                $("#btnBURAMSave").attr('disabled', true);

            }
            else if (self.LOGINROLEID() == 6 && self.GETUBRAMDTLS()[0].IsProcessStart() == false) {
                $("#txtcomments").attr('disabled', false);
                $("#txtQAcomments").attr('disabled', true);
                $("#txtccecomments").attr('disabled', true);
            }
        }
        else {
            $("#txtcomments").attr('disabled', true);
            $("#txtQAcomments").attr('disabled', false);
            $("#txtccecomments").attr('disabled', true);
            $("#chksubmit").attr('disabled', true);
        }
    }
    function GetUBBURAMDtlsByID(vBuidPK) {
        $.ajax({
            type: "POST",
            data: ko.toJSON({ ipBuidPK: vBuidPK }),
            url: "../BURAMPages/CreateEditUBBURAM.aspx/GetBUDetailsByID",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (results) {
                if (results.d.length > 0) {
                    var vResults = $.map(results.d, function (item) { return new tblUBRAMDetails(item) });
                    self.GETUBRAMDTLS(vResults);
                    self.GetControlFlow(self.GETUBRAMDTLS()[0].EPMID())
                }
                else { self.GETUBRAMDTLS(GetEmptyUBRAM()); }
            },
            error: function (err) {
                alert(err.responseText + " - " + err.statusText);
            }
        });
    }

    function InsUpdateBBURAMDtls() {
        var vBuname = $("#ddlbu option:selected").text();
        $.ajax({
            type: "POST",
            data: ko.toJSON({ data: self.GETUBRAMDTLS, ipRoleID: self.LOGINROLEID, sBuName: vBuname }),
            url: "../BURAMPages/CreateEditUBBURAM.aspx/SaveUBRAMDetails",
            contentType: "application/json; charset=utf-8",
            success: function (result) {
                vBuidPK = result.d;
                GetUBBURAMDtlsByID(vBuidPK);
                if (vBuidPK=="-1")
                    alert("The " + vBuname + " is already existed for the same date. You cannot create it.");
                else alert("Record successfully updated.");
            },
            error: function (err) {
                alert(err.statusText);
            }
        });
    }

    self.SaveUBRAMDtls = function () {
        InsUpdateBBURAMDtls();
    }
}; //End View..
$(document).ready(function () {
    $("#txtasof").datepicker();
    var vBURAMView = new BURAMVIEW();
    vBuidPK = 0;
    var qrStr = window.location.search;
    var spQrStr = qrStr.substring(1);
    var arr = spQrStr.split('&');
    var queryvalue = "";
    if (arr[0]) {
        queryvalue = arr[0].split('=');
        if (queryvalue[1])
            vBuidPK = queryvalue[1];
    }

    ko.applyBindings(vBURAMView);
    vBURAMView.LoadInitalData()
    vBURAMView.LoginDetails();
    vBURAMView.EditUBDetails();
});

ASP.NET CODE..

<asp:Content ID="cntEditBURAM" ContentPlaceHolderID="MainContent" runat="server">
    <script language="javascript" type="text/javascript">
        function DownLoadFile(RptName, Id) {
            window.open('~/DownloadFile.aspx?Rptname=' + RptName + '&Id=' + Id);
            return false;
        }
    </script>
    <div>
        <table id="tblBorrowerdetails" width="100%" class="sechdr">
            <tr>
                <td>
                    <asp:ValidationSummary ID="CreateBURAMValidationSummary" runat="server" CssClass="failureNotification"
                        ValidationGroup="BURAMValidationGroup" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblerrmsg" runat="server" CssClass="CIMSlbel" ForeColor="Red" />
                </td>
            </tr>
            <tr>
                <td class="CRAHomeHeader">
                    <asp:Label ID="lblAddEditburam" runat="server" ForeColor="Blue" />
                </td>
            </tr>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td class="style1" style="width: 141px">
                                <asp:Label ID="lblbusinessunit" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td>
                                <telerik:RadComboBox ID="radcmbbusinessunit" runat="server" Width="400px" />
                                <asp:RequiredFieldValidator ID="rfvbusinessUnit" runat="server" ControlToValidate="radcmbbusinessunit"
                                    InitialValue="--Select--" CssClass="failureNotification" ErrorMessage="Businessunit name is required."
                                    ToolTip="Businessunit name is required." ValidationGroup="BURAMValidationGroup">*</asp:RequiredFieldValidator>
                            </td>
                            <td>
                                <asp:Label ID="lblasofdate" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td>
                                <telerik:RadDatePicker ID="raddtasofdate" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvasofdate" runat="server" ControlToValidate="raddtasofdate"
                                    CssClass="failureNotification" ErrorMessage="Asof date is required." ToolTip="Asof date is required."
                                    ValidationGroup="BURAMValidationGroup">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblcountrygrade" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtcountrygrade" CssClass="CIMStext" runat="server" MaxLength="2" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td class="style1" style="width: 143px">
                                <asp:Label ID="lblcreditexposure" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtcreditexposure" runat="server" Width="150px" />
                            </td>
                            <td style="width: 183px">
                                <asp:Label ID="lblexpectedloss" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtexpectedloss" runat="server" Width="150px" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style1" style="width: 143px">
                                <asp:Label ID="lblcorerating" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtcorerating" runat="server" Width="150px" />
                            </td>
                            <td style="width: 183px">
                                <asp:Label ID="lblfinalrating" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtfinalrating" runat="server" Width="150px" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style1" style="width: 143px">
                            </td>
                            <td style="width: 184px">
                            </td>
                            <td style="width: 183px">
                                <asp:Label ID="lblriskfactor" runat="server" CssClass="CIMSlbel" ForeColor="Red" />
                            </td>
                            <td style="width: 184px">
                                <asp:Label ID="lblralativeweighting" runat="server" CssClass="CIMSlbel" ForeColor="Red" />
                            </td>
                            <td style="width: 192px">
                                <asp:Label ID="lblweightedrisk" runat="server" CssClass="CIMSlbel" ForeColor="Red" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style1" style="width: 143px">
                                <asp:Label ID="lblaqcr" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadComboBox ID="radcmbaqcr" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvaqcr" runat="server" ControlToValidate="radcmbaqcr"
                                    InitialValue="--Select--" CssClass="failureNotification" ErrorMessage="AQCR is required."
                                    ToolTip="AQCR is required." ValidationGroup="BURAMValidationGroup">*</asp:RequiredFieldValidator>
                            </td>
                            <td style="width: 183px">
                                <telerik:RadNumericTextBox ID="txtAQCRRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtAQCRRW" runat="server" Width="150px" />
                            </td>
                            <td style="width: 192px">
                                <telerik:RadNumericTextBox ID="txtAQCRWRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style1" style="width: 143px">
                                <asp:Label ID="lblaqtrend" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadComboBox ID="radcmbaqtrend" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvAQTrend" runat="server" ControlToValidate="radcmbaqtrend"
                                    InitialValue="--Select--" CssClass="failureNotification" ErrorMessage="AQTrend risk is required."
                                    ToolTip="AQTrend risk is required." ValidationGroup="BURAMValidationGroup">*</asp:RequiredFieldValidator>
                            </td>
                            <td style="width: 183px">
                                <telerik:RadNumericTextBox ID="txtaqtrendrRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtaqtrendrRW" runat="server" Width="150px" />
                            </td>
                            <td style="width: 192px">
                                <telerik:RadNumericTextBox ID="txtaqtrendrWRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style1" style="width: 143px">
                                <asp:Label ID="lblAcctimelines" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadComboBox ID="radcmbacctimelines" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvAcctimeline" runat="server" ControlToValidate="radcmbacctimelines"
                                    InitialValue="--Select--" CssClass="failureNotification" ErrorMessage="Accuracy & timeliness is required."
                                    ToolTip="Accuracy & timeliness is required." ValidationGroup="BURAMValidationGroup">*</asp:RequiredFieldValidator>
                            </td>
                            <td style="width: 183px">
                                <telerik:RadNumericTextBox ID="txtAcctimelineRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtAcctimelineRW" runat="server" Width="150px" />
                            </td>
                            <td style="width: 192px">
                                <telerik:RadNumericTextBox ID="txtAcctimelineWRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style1" style="width: 143px">
                                <asp:Label ID="lblpoliciesandproc" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadComboBox ID="radcmbpolicesandprocs" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvpolicesandprocs" runat="server" ControlToValidate="radcmbpolicesandprocs"
                                    InitialValue="--Select--" CssClass="failureNotification" ErrorMessage="Policies procedures is required."
                                    ToolTip="Policies procedures is required." ValidationGroup="BURAMValidationGroup">*</asp:RequiredFieldValidator>
                            </td>
                            <td style="width: 183px">
                                <telerik:RadNumericTextBox ID="txtpolicesandprocRF" runat="server" Width="150px"
                                    ReadOnly="true" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtpolicesandprocRW" runat="server" Width="150px" />
                            </td>
                            <td style="width: 192px">
                                <telerik:RadNumericTextBox ID="txtpolicesandprocWRF" runat="server" Width="150px"
                                    ReadOnly="true" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style1" style="width: 143px">
                                <asp:Label ID="lblcreditprocess" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadComboBox ID="radcmbcreditprocess" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvcreditprocess" runat="server" ControlToValidate="radcmbcreditprocess"
                                    InitialValue="--Select--" CssClass="failureNotification" ErrorMessage="Credit process is required."
                                    ToolTip="Credit process is required." ValidationGroup="BURAMValidationGroup">*</asp:RequiredFieldValidator>
                            </td>
                            <td style="width: 183px">
                                <telerik:RadNumericTextBox ID="txtcreditprocessRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtcreditprocessRW" runat="server" Width="150px" />
                            </td>
                            <td style="width: 192px">
                                <telerik:RadNumericTextBox ID="txtcreditprocessWRF" runat="server" Width="150px"
                                    ReadOnly="true" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style1" style="width: 143px">
                                <asp:Label ID="lblportfoliomgmt" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadComboBox ID="radcmbportfoliomgmt" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvportfoliomgmt" runat="server" ControlToValidate="radcmbportfoliomgmt"
                                    InitialValue="--Select--" CssClass="failureNotification" ErrorMessage="Portfolio management is required."
                                    ToolTip="Portfolio management is required." ValidationGroup="BURAMValidationGroup">*</asp:RequiredFieldValidator>
                            </td>
                            <td style="width: 183px">
                                <telerik:RadNumericTextBox ID="txtportfoliomgmtRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtportfoliomgmtRW" runat="server" Width="150px" />
                            </td>
                            <td style="width: 192px">
                                <telerik:RadNumericTextBox ID="txtportfoliomgmtWRF" runat="server" Width="150px"
                                    ReadOnly="true" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style1" style="width: 143px">
                                <asp:Label ID="lblinternalcontrols" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadComboBox ID="radcmbinternalcontrols" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvintercontrols" runat="server" ControlToValidate="radcmbinternalcontrols"
                                    InitialValue="--Select--" CssClass="failureNotification" ErrorMessage="Internal controls is required."
                                    ToolTip="Internal controls is required." ValidationGroup="BURAMValidationGroup">*</asp:RequiredFieldValidator>
                            </td>
                            <td style="width: 183px">
                                <telerik:RadNumericTextBox ID="txtinternalcontrolsRF" runat="server" Width="150px"
                                    ReadOnly="true" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtinternalcontrolsRW" runat="server" Width="150px" />
                            </td>
                            <td style="width: 192px">
                                <telerik:RadNumericTextBox ID="txtinternalcontrolsWRF" runat="server" Width="150px"
                                    ReadOnly="true" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style1" style="width: 143px">
                                <asp:Label ID="lblpersonals" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadComboBox ID="radcmbpersonals" runat="server" />
                                <asp:RequiredFieldValidator ID="rfvpersonal" runat="server" ControlToValidate="radcmbpersonals"
                                    InitialValue="--Select--" CssClass="failureNotification" ErrorMessage="Personnel is required."
                                    ToolTip="Personnel is required." ValidationGroup="BURAMValidationGroup">*</asp:RequiredFieldValidator>
                            </td>
                            <td style="width: 183px">
                                <telerik:RadNumericTextBox ID="txtpersonalsRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtpersonalsRW" runat="server" Width="150px" />
                            </td>
                            <td style="width: 192px">
                                <telerik:RadNumericTextBox ID="txtpersonalsWRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style1" style="width: 143px">
                                <asp:Label ID="lblLMH" runat="server" CssClass="CIMSlbel" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadComboBox ID="radcmbLMH" runat="server" Enabled="false" ForeColor="YellowGreen" />
                            </td>
                            <td style="width: 183px">
                                <telerik:RadNumericTextBox ID="txtLMHRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                            <td style="width: 184px">
                                <telerik:RadNumericTextBox ID="txtLMHRW" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                            <td style="width: 192px">
                                <telerik:RadNumericTextBox ID="txtLMHWRF" runat="server" Width="150px" ReadOnly="true" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td style="width: 143px; vertical-align: top">
                                <asp:Label ID="lblcomments" runat="server" CssClass="CIMSlbel" ForeColor="Red" />
                                <div>
                                    <div>
                                        <asp:Label ID="lbllevel" runat="server" CssClass="CIMSlbel" Text="Level of Risk:" /></div>
                                </div>
                                <div>
                                    <div>
                                        <asp:DropDownList ID="ddllevelofrisk" runat="server" />
                                    </div>
                                </div>
                                <div>
                                    <asp:Label ID="lbltrend" runat="server" CssClass="CIMSlbel" Text="Trend of Risk:" /></div>
                                <div>
                                    <asp:DropDownList ID="ddltrendofrisk" runat="server" />
                                </div>
                            </td>
                            <td>
                                <asp:TextBox ID="txtcomments" runat="server" TextMode="MultiLine" Height="78px" Width="713px" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 143px; vertical-align: top">
                                <asp:Label ID="lblccecomments" runat="server" CssClass="CIMSlbel" ForeColor="Red" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtCCEComments" runat="server" TextMode="MultiLine" Height="78px"
                                    Enabled="false" Width="713px" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <table>
                        <tr>
                            <td>
                                <asp:Button ID="btnupdate" runat="server" OnClick="btnupdate_Click" ValidationGroup="BURAMValidationGroup"  Enabled="false"/>
                            </td>
                            <td>
                                <asp:Button ID="btnprint" runat="server" ValidationGroup="BURAMValidationGroup" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>

Keuller Magalhaes

unread,
Jul 3, 2014, 2:06:47 PM7/3/14
to knock...@googlegroups.com
Sriram,

You're using ASP.NET server tags, these tags are processed by the server not on browser. Knockout acts on client side through data-bind attribute.

I believe when you load your page the data comes from server via some object that was populated by server through ASP.NET MVC, after that process the HTML page was generated and there is no data-bind attribute tag in your HTML page. Becasuse that Knockout does not trigged.

You must be use REST service and load the data from it service and bind using Knockout with plain HTML.

I hope help you.

Regards.
...
Message has been deleted

Sriram Ramapragada

unread,
Jul 3, 2014, 2:23:57 PM7/3/14
to knock...@googlegroups.com
When i debug issue 


On Thursday, July 3, 2014 2:06:47 PM UTC-4, Keuller Magalhaes wrote:
Sriram,

You're using ASP.NET server tags, these tags are processed by the server not on browser. Knockout acts on client side through data-bind attribute.

I believe when you load your page the data comes from server via some object that was populated by server through ASP.NET MVC, after that process the HTML page was generated and there is no data-bind attribute tag in your HTML page. Becasuse that Knockout does not trigged.

You must be use REST service and load the data from it service and bind using Knockout with plain HTML.

I hope help you.
1)  vBURAMView.LoadInitalData() is executing/loading/triggers after  data after (3) but compiles normally..
2)  vBURAMView.LoginDetails();
3)  vBURAMView.EditUBDetails();
 
I  apologies for pasting the wrong file..

                        &nb
...
Reply all
Reply to author
Forward
0 new messages