Wednesday, 24 July 2019

How to do the Ajax Call in SAP UI5 ?

url = "/pwc/Odtaserv/"+pakid;

jsonModelObj = new JsonModel();

jsonModelObj .attachRequestCompleted(function(oEvent) {

if(oevnt.getparameter. == "sucess")
{

}   
 
}, this).loadData(url,"",false);

Thursday, 14 September 2017

How to align button to center in sap ui5 ?

<Bar>
<contentMiddle>
<Button text="Submit" press="onPresssubmitButton" />
</contentMiddle>
</Bar>

Thursday, 23 March 2017

How to add table to dialogue dynamically in sap ui 5 ?

addingtabledata_dynamic:function(){


                                         var oDialog1 = new sap.m.Dialog();

                                         var image1 = new sap.m.Image({
                                                src : "sap-icon://inventory",
                                                tap : [ function(oEvent) {
                                                       var control = oEvent.getSource();

                                                       oDialog1.close();
                                                }, this ]
                                         });

                                        
                                         var oTable = new sap.m.Table("oTable",{
                                               columns: [new sap.m.Column({
                                                   header: new sap.m.Label({
                                                     text: "Product"
                                                   })
                                                 }),
                                                 new sap.m.Column({
                                                   header: new sap.m.Label({
                                                     text: "Weight"
                                                   })
                                                 }),
                                                       new sap.m.Column({
                                                   header: new sap.m.Label({
                                                     text: "Add"
                                                   })
                                                 })
                                               ],
                                               items: {
                                                 path: '/value',
                                                 template: new sap.m.ColumnListItem({
                                                   cells: [new sap.m.Text({
                                                       text: "{OrderID}"
                                                     }),
                                                     new sap.m.Text({
                                                       text: "{OrderID}"
                                                     }),
                                                              new sap.ui.core.Icon({
                                                                     src:"sap-icon://add",
                                                                     press: function(oEvent){
                                                                       oController.onAdd();
                                                                     }
                                                              })
                                                   ]
                                                 })
                                               }
                                             });
                                        
                                        
                                         oTable.setModel(json_model);
                                        

                                      

                                         oDialog1.addContent(image);
                                        
                                         oDialog1.addContent(oTable);

                                         oDialog1.open();

}

How to allow only numbers in Input box of sap Ui5 ?


use Liveupdate="validateFunction" param for Input View


 validateFunction : function(oEvent) {

                                       

                                         var ovalid=oEvent.oSource;
                                         var newValue = oEvent.getParameter("value");
                                         if(isNaN(newValue)){
                                                                ovalid.setValueState(sap.ui.core.ValueState.Error);
                                                ovalid.setValue("");
                                                return false;
                                         }
                                         else
                                         {
                                                ovalid.setValueState(sap.ui.core.ValueState.None);
                                         }
 }

Friday, 17 March 2017

How to know the Index of the List ins sap Ui5 ?

                                     
presseventofListItem:function(oEvent){


                                       var oList = oEvent.getSource();
                                         var oItem = oEvent.getParameter("listItem");
                                         var sPath = oItem.getBindingContext().getPath();


}
                                    

How to develop sap ui5 apps in sap web ide in online ?

First Register /login the

https://account.hanatrial.ondemand.com/


after login ..

if you can open the Development Editor .

go to services (available in left hand side in your trail account)


we wil see many options select SAP web ide/innovation web IDE  (updation  version of Web ide).

you can create your application .


if anything you want to interact with the server with online web ide .

first we have to install the Web Ide connector in our local machine .

available here :

https://tools.hana.ondemand.com/#cloud





Complete Guide  step by step process Available Here :

https://blogs.sap.com/2015/02/11/set-up-your-sap-web-ide-on-hana-cloud-part-2/



How to develop the List as Table in sap ui5 ?



We can use the CustomListItem in the List  to show as table in sap ui5.


please follow the below link