Tuesday, January 29, 2019

Widget Mapping

var gridArr2 = [];
var gridArr3 = [];
function PusSD(){
  try{
    var SName = frmwMdata.txtName.text;
    var Smark = frmwMdata.txtMark.text;
    var SPercent = frmwMdata.txtpercenntage.text;
    var SPass = frmwMdata.rdoResult.selectedKeyValue[1];
    if(frmwMdata.txtName.text ==="" || frmwMdata.txtName.text === null || frmwMdata.txtName.text ===" " ||frmwMdata.txtName.text === undefined){
    frmwMdata.txtName.setFocus(true);
    return false;
  }
    if(frmwMdata.txtMark.text ==="" || frmwMdata.txtMark.text === null || frmwMdata.txtMark.text ===" " ||frmwMdata.txtMark.text === undefined){
    frmwMdata.txtMark.setFocus(true);
    return false;
  }
      if(frmwMdata.txtpercenntage.text ==="" || frmwMdata.txtpercenntage.text === null || frmwMdata.txtpercenntage.text ===" " ||frmwMdata.txtpercenntage.text === undefined){
    frmwMdata.txtpercenntage.setFocus(true);
    return false;
  }
      if(SPass ==="" || SPass === null || SPass ===" " ||SPass === undefined){
    frmwMdata.rdoResult.setFocus(true);
    return false;
  }
    var OBJ = {"SName":frmwMdata.txtName.text,"Smark":frmwMdata.txtMark.text,
               "SPercent": frmwMdata.txtpercenntage.text,"SPass":frmwMdata.rdoResult.selectedKeyValue[1]};
 
    if(OBJ.SPass === "PASS"){
       frmWM.segwm.widgetDataMap = {"lblName":"SName","lblMark":"Smark","lblPercentage":"SPercent"};
      frmWM.segwm.rowTemplate = flxmainPS;
    //  frmWM.segwm.setData(gridArr2);
    }else if(OBJ.SPass === "FAIL"){
      frmWM.segwm.widgetDataMap = {"lblNameF":"SName","lblMarkf":"Smark","lblPercentagef":"SPercent"};
      frmWM.segwm.rowTemplate = flxmainFS;
      //frmWM.segwm.data ="";
    }
    gridArr2.push(OBJ);
    //gridArr3.push(gridArr2);
    frmWM.segwm.setData(gridArr2);
    //gridArr2=[];
    frmwMdata.destroy();
    frmWM.show();

  }catch(err){
    alert("Error "+ err);
  }
}

0 comments:

Post a Comment