Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8720

Re: Load Dialog on Startup

$
0
0

And when I added below code inside Create Content

var layoutNew = new sap.ui.commons.layout.MatrixLayout("layout1", {width:"auto"});

   

    var oVal1 = new sap.ui.commons.TextField("cArea",{tooltip: "Controlling Area", width: "200px", editable:true});

    var oVal2 = new sap.ui.commons.TextField("sDate",{tooltip: "Start Date", width: "200px", editable:true});

    var oVal3 = new sap.ui.commons.TextField("eDate",{tooltip: "End Date", width: "200px", editable:true}); 

    var oVal4 = new sap.ui.commons.TextField("isRead",{tooltip: "Is Read", width: "200px", editable:true});

 

    var oExcButton = new sap.ui.commons.Button({

        text : "Submit",press:function(){

       //var oLabel = new sap.ui.commons.Label("l1");

    //oLabel.setText(CArea);

       oDialog1.close();}});

        //press : oController.callOdataService });

    layoutNew.createRow(new sap.ui.commons.Label({text: "Controlling Area: "}), oVal1 ); 

       layoutNew.createRow(new sap.ui.commons.Label({text: "Start Date: "}), oVal2 );

       layoutNew.createRow(new sap.ui.commons.Label({text: "End Date: "}), oVal3 );

       layoutNew.createRow(new sap.ui.commons.Label({text: "Is Read: "}), oVal4 );

       layoutNew.createRow(new sap.ui.commons.Label(),oExcButton);

 

 

var oDialog1 = new sap.ui.commons.Dialog();

oDialog1.setTitle("Enter Input Parameters");

oDialog1.setShowCloseButton();

oDialog1.addContent(layoutNew);

 

And then tried to call oDialog1 inside OpenDialog function, I got the below error

 

openDialog : function(){

  oDialog1.open();

  }

 

  1. Uncaught ReferenceError: oDialog1 is not defined Test.view.js:397
    1. sap.ui.jsview.openDialogTest.view.js:397
    2. sap.ui.jsview.createContentTest.view.js:17
    3. (anonymous function)JSView.js:6
    4. sap.ui.base.ManagedObject.runWithPreprocessorssap-ui-core.js:117
    5. sap.ui.core.mvc.JSView.onControllerConnectedJSView.js:6
    6. sap.ui.core.mvc.View._initCompositeSupportView.js:6
    7. sap.ui.base.EventProvider.extend.constructorsap-ui-core.js:117
    8. sap.ui.base.ManagedObject.extend.constructorsap-ui-core.js:117
    9. sap.ui.core.Element.extend.constructorsap-ui-core.js:117
    10. fsap-ui-core.js:117
    11. fsap-ui-core.js:117
    12. osap-ui-core.js:117
    13. sap.ui.viewView.js:6
    14. o.(anonymous function)sap-ui-core.js:117
    1. (anonymous function)

    2. Regards,
  2. Rohit

Viewing all articles
Browse latest Browse all 8720

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>