Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all 6178 articles
Browse latest View live

passing parameters with ajax url

$
0
0

Hi experts

 

I am fetching some data from xsjs application using ajax in my ui5 application,i can pass two variables with ajax url as shown below

var aUrl="/XXXXX/XXXXX/Status.xsjs?n1=' + y + '&n2=6';

But i cant pass three variables with url

var aUrl ='/XXXXXX/XXXXX/Status.xsjs?n1=' + y + '&n2=6&n3='+Status;

 

Thanks


Odata service within a Calculation view (max. aggr.)

$
0
0

Hi,

 

I created an calculation view where I aggregate data to get only the last actual result of a labor list.

If I check the result of the calculation view with hana (open content) than it looks right.

But If I call the odata service within this calculation view than I get a wrong result back.

 

Right:

Hana: This is right, I get the last labor result.

labor_hana.PNG

 

Wrong:

xsodata service: I get the last the last result but with all the same values. Does somebody has similar experiences and an idea what the reason could be?

 

labor.PNG

Question about table add Function with xml.view and js controller

$
0
0

I want to add table row in xml.view using js controller. I tried many times but i couldn't figure out.. Please help me senior Ui developers!!


xml.view

 

<object:ObjectPageSection title ="Item"/>

 

 

  <content>

  <t:Table id ="itemTable" visibleRowCount = "1" firstVisibleRow = "1">

  <t:toolbar>

  <Toolbar>

  <ToolbarSpacer/>

  <Button icon = "sap-icon://add" press = "Add" />

  </Toolbar>

  </t:toolbar>

  <t:Column autoResizable = "true">

  <Label text = "MM#"/>

  <t:template><c:TextField value = "{mm}"/></t:template>

  </t:Column>

  <t:Column autoResizable = "true">

  <Label text = "Description" />

  <t:template><c:TextView text = "{des}" /></t:template>

  </t:Column>

  <t:Column autoResizable = "true">

  <Label text = "Qty" />

  <t:template><c:TextView text = "{qty}"/></t:template>

  </t:Column>

  <t:Column autoResizable = "true">

  <Label text = "Unit" />

  <t:template><c:TextView text = "{unit}"/></t:template>

  </t:Column>

  <t:Column autoResizable = "true">

  <Label text = "@ Price" />

  <t:template><c:TextView text = "{price}"/></t:template>

  </t:Column>

  <t:Column autoResizable = "true">

  <Label text = "Net Amount" />

  <t:template><c:TextView text = "{net}"/></t:template>

  </t:Column>

 

  </t:Table>

 

controller.js

 

sap.ui.controller("zhmmatest.CreatePR", {

 

 

  onInit: function() {

 

 

  },

 

 

 

  Add: function (oEvent) {

  var oTable = sap.ui.getCore().byId("itemTable");

  var oPath = oTable.getBinding().getPath();

  var oModel = oTable.getModel().getProperty(oPath);

  console.log(oModel);

  oModel.unshift({

  mm: 6,

  des: "hello",

  qty: 12,

  unit: 13,

  price: 12,

  net: 12

  });

  oTable.getModel().setProperty(oPath, oModel);

  otable.bindRows(oPath);

 

  }

 

 

});

Facing a issue while creating amount and date fields in ui5

$
0
0

Dear Experts,

 

 

I am consuming Odata services in ui5 for date(edm.datetime), amount fields but i try to create fields in front end(ui5) it throws error. but delete functionality works create,update not working

 

 

please find attachement code below

Router Hash-Value not resolved

$
0
0

Hey guys,

 

I am having problems with the navigation by the routing concept, but I can't find my mistake. The hash value of the URL is somehow not resolved. See following code:

 

1.png

 

2.PNG

 

Using an empty hash ("pattern": "") the right target view is loaded.

 

Any ideas?

 

Thanks and regards

Chris

SAP's mechanism used for Minify/Dbg

$
0
0

Hello,

 

I have been trying to gather inputs on SAP's own technique followed to generate minified and dbg files.

ie How debug files are created internally in SAP UI5 Diagnostics tool and how minified files are generated for productive use.

In Web IDE can we see the minify/dbg files generated?

 

I came across YUICompressor, GRUNT plugins available to achieve it explicitly during custom implementation.

 

Please share some light on SAP's framework technique.

 

Thanks,

Dhanya

Code completion in SAP UI5

$
0
0

Hello,

 

I am using eclipse ADT to create SAPUI5 application. I have gone through various tutorials in achieving the code completion process when developing the application.

 

After following all the mentioned steps I am not able to fix the issue for code completion. Like in below screen shots, when I am trying to set the properties as setDisplayBlock(true) it works fine but with CTRL+SPACE doesn't bring that method but it gives the list of other public methods as follows:

img1.PNG

img2.PNG

I followed the steps as mentioned in below link: JavaScript Code Completion - SAPUI5: UI Development Toolkit for HTML5 - SAP Library

 

Please advice.

 

Thanks, SL

XML coding views

$
0
0

Hi,

 

I am currently learning SAP UI5, in particularly XML views but struggle to get my head around adding ui5 controls to a XML view. I understand how to do this in JS but not XML.

 

I have the code below which consists of two texts, two text fields and a toggle. The code also has an matrixlayout but when running the application, i see a blank light blue screen in webide. when i remove the matrix layout coding so that only the texts, textfields and  toggle button coding remains it works but the ui controls are not neatly aligned hence why i want to use the matrix layout. any idea what i am missing with the matrixlayout code? print screen of xml code attached..

 

 

any links to xml view tutorials would be helpful

 

Thanks in advance

 

Adnan


Navigation in ObjectPageSection option

$
0
0

Hi All,

 

           In one of my design, am using ObjectPageLayout option, in this am having multiple ObjectPageSection with subSections.

My requirement is, Inside subSections am using one button and i want to map the button event with Anchor Bar action.

For example, there are section A & B

In A -- subsections are A.1,A.2,A.3

In B -- subsections are B.1 B.2, B.3

 

Inside A.1 am having button, while clicking this button I want to navigate the user to subsections B.2.

 

Please anyone guide me to achieve this functionality...

 

-Mahi

WebIDE vs Eclipse UI5 development plugin

$
0
0

Hi,

 

WebIDE seems to be updated on a regular basis whereas the Eclipse plugin only seems to be updated when there is a new release of Eclipse.

 

am i correct in assuming that Eclipse is not actively supported?

Data binding issue with JSON Model

$
0
0

Hi,

 

I am reading data from SAP using OData Model and creating the JSON Model base on that. Following code I have written in Component.js file for reading the data.

 

oModel = new sap.ui.model.odata.ODataModel(sUrl, true);

 

oModel.read("DealCollection", null, null, false, function(oData, oResponse){

 

var oJsonModel = new sap.ui.model.json.JSONModel(oData);

oView.setModel(oJsonModel);

sap.ui.getCore().setModel(oJsonModel);

   });

  

 

Now I am trying to bind items for List control in Master view with following code:

 

<List id="list" mode="{device>/listMode}" select="handleListSelect" items="{/DealCollection}">

 

 

But its not displaying any data in list. I have debug and check, data is coming correctly in JSON Model. Not sure why its not display data in List. Am I missing something there?

 

If I use ODataModel or JSONModel with file path, List binding works and displaying the data. But with above approach, converting ODataModel to JSONModel, List control binding is not working and not displaying any data.

 

Any suggestion?

 

Regards,

Vikram

WebIDE Git client run as Fiori Application doesn't work

$
0
0

Hello ,

 

we would create a central git repo for all our  ui5 applications and now we have the problem when we create sub folders in the git repo.

And copy ui5 projects in there , we can't start this applications we get an 404 Error ?

 

 

Regards

 

Daniel

Object Page layout

$
0
0

Hi when iam trying to implement an object with the following link

OpenUI5 Explored

Iam getting the following error.

Please if anybody faced this kind of situation please help me to resolve my issue.object.png

Navigate to next page

$
0
0

Hi,

I am getting error while adding the path of xmlview.

Can anyone please help me?

I am a beginner in this new technology.

This is my index.html.

My project name is SAP_New and view name is sap_new and Create.view.xml is my view in xml.

 

 

  <script type="text/javascript">

  sap.ui.getCore().attachInit(function () {

  // create a mobile app and display page1 initially

  var app = new sap.m.App("myApp", {

  initialPage: "page1"

  });

 

 

  // create the first page

  var page1 = new sap.m.Page("page1", {

 

  showNavButton: false,

  content: new sap.m.StandardTile({

  title: "Display Inventory and Activity Differences",

                  icon : "sap-icon://product",

  press: function () {

  // navigate to page2

  app.to("page2");

  }

  })

  });

 

 

  // create the second page with a back button

  var page2 = new sap.m.Page("page2", {

  title: "Hello Page 2",

  showNavButton: true,

  navButtonPress: function () {

  app.back();

  },

                                                                        /*            content: new sap.ui.core.mvc.XMLView({

                                                                                                 id : "testview",

                                                                                                  viewName : "com.Create.View", //path to your view

                                                                                            })

                                                                         */

  });

 

 

  // add both pages to the app

  app.addPage(page1).addPage(page2);

  // place the app into the HTML document

  app.placeAt("content");

  });

  </script>

sap ui5

$
0
0

Hi

am new  to the sap ui5,

can any one guide me where  i start.


Can anyone explain how to implement the cache handling in sapui5 local server?

What's the future of sap.viz.ui5??? How to create an custom chart extension??

$
0
0

Hi guys,

 

I'm seeking a way to create custom D3 chart extension which can be easily integrated into SAPUI5 application. I'm looking into the sap.viz.ui5 library. But I don't find a tutorial for how to create a custom chart type.

 

Can somebody share some experience about that??

 

Regards,

Aaron

Hi i am able to run the SAP UI5 arithematic operation in eclipse but the same code doesn't give any output in sap web ide.

$
0
0

<script type="text/javascript">

 

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

oLabel1.setText("Number1");

oLabel1.placeAt("content");

 

 

var oInput1 = new sap.ui.commons.TextField('input1');

//oInput1.setValue("Some Text");

oInput1.setTooltip("Input Positive number1");

//oInput1.attachChange(function(){alert('Text changed to :'+ oInput1.getValue());})

oInput1.placeAt("content");

 

 

 

 

var oLabel2 = new sap.ui.commons.Label("l2");

oLabel2.setText("Number2");

oLabel2.placeAt("content1");

 

 

var oInput2 = new sap.ui.commons.TextField('input2');

//oInput1.setValue("Some Text");

oInput2.setTooltip("Input Positive Number2");

//oInput1.attachChange(function(){alert('Text changed to :'+ oInput1.getValue());})

oInput2.placeAt("content1");

 

 

 

 

var oLabel3 = new sap.ui.commons.Label("l3");

oLabel3.setText("Result");

oLabel3.placeAt("content2");

 

 

var oInput3 = new sap.ui.commons.TextField('Result');

//oInput1.setValue("Some Text");

oInput3.setTooltip("Result");

//oInput1.attachChange(function(){alert('Text changed to :'+ oInput1.getValue());})

oInput3.placeAt("content2");

 

 

 

 

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

 

  text:"Add",

  style:sap.ui.commons.ButtonStyle.Emph,

  //icon : "C:/Users/MM0387/Pictures/venu.png",

  //"Alert from SAP UI5 First Program " +myButton.getText());

  press:function()

  {

   var oTF1 = sap.ui.getCore().getElementById("input1").getValue();

          var oTF2 = sap.ui.getCore().getElementById("input2").getValue();

          if(oTF1<0 || oTF2<0)

          alert("Enter only Positive Numbers");

          else

          var oTF3 = sap.ui.getCore().getElementById("Result");

          oTF3.setValue(+oTF1 + +oTF2);

  }

  }).placeAt("content3");

  // myButton.attachPress(oController.handleButtonClicked);

 

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

  text:"Subtract",

  style:sap.ui.commons.ButtonStyle.Emph,

  //icon : "C:/Users/MM0387/Pictures/venu.png",

  //"Alert from SAP UI5 First Program " +myButton.getText());

  press:function()

  {

   var oTF1 = sap.ui.getCore().getElementById("input1").getValue();

          var oTF2 = sap.ui.getCore().getElementById("input2").getValue();

          if(oTF1<0 || oTF2<0)

          alert("Enter only Positive Numbers");

          else

         

          var oTF3 = sap.ui.getCore().getElementById("Result");

          oTF3.setValue(+oTF1 - +oTF2);

  }

  }).placeAt("content3");

 

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

 

  text:"Divide",

  style:sap.ui.commons.ButtonStyle.Emph,

  //icon : "C:/Users/MM0387/Pictures/venu.png",

  //"Alert from SAP UI5 First Program " +myButton.getText());

  press:function()

  {

   var oTF1 = sap.ui.getCore().getElementById("input1").getValue();

          var oTF2 = sap.ui.getCore().getElementById("input2").getValue();

          if(oTF1<0 || oTF2<0)

          alert("Enter only Positive Numbers");

          else

          var oTF3 = sap.ui.getCore().getElementById("Result");

          oTF3.setValue(+oTF1 / +oTF2);

  }

  }).placeAt("content3");

 

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

  text:"Multiply",

  style:sap.ui.commons.ButtonStyle.Emph,

  //icon : "C:/Users/MM0387/Pictures/venu.png",

  //"Alert from SAP UI5 First Program " +myButton.getText());

  press:function()

  {

   var oTF1 = sap.ui.getCore().getElementById("input1").getValue();

          var oTF2 = sap.ui.getCore().getElementById("input2").getValue();

          if(oTF1<0 || oTF2<0)

          alert("Enter only Positive Numbers");

          else

          var oTF3 = sap.ui.getCore().getElementById("Result");

          oTF3.setValue(+oTF1 * +oTF2);

  }

  }).placeAt("content3");

 

  myButton1.setTooltip("Adds the values of Number1 & Number2");

  myButton2.setTooltip("Subtracts the value from Number1 & Number2");

  myButton3.setTooltip("Divides the value from Number1 & Number2");

  myButton4.setTooltip("Provides the Product value of Number1 & Number2");

 

  </script>

Problems with date fields in ui5

$
0
0

Dear Experts,

 

I am consuming odata services from ui5 . in that date format would be YYYY-MM-DDTHH:MM:SS how can i remove Time fields i am using xml view in ui5

 

my code

<Table id="idProductsTable"

  inset="false"

  mode= "SingleSelectLeft"

  items="{

  path: 'empModel>/crudSet'

  }">

  <columns>

  <Column>

  <Text text="Amount" />

  </Column>

  <Column>

  <Text text="Dates" />

  </Column>

 

  </columns>

  <items>

  <ColumnListItem>

  <cells>

  <Text

  text="{empModel>Amount}" />

  <Text

  text="{empModel>Dates}" />

 

  </cells>

  </ColumnListItem>

  </items>

  </Table>

  <Button xmlns="sap.m"

  id="IdDisplay"

  text="Display"

  press="onDisplay">

</Button>

<Button xmlns="sap.m"

  id="IdCreate"

  text="Create"

  press="onCreate">

</Button>

<Button xmlns="sap.m"

  id="IdUpdate"

  text="Update"

  press="onUpdate">

</Button>

<Button xmlns="sap.m"

  id="IdDelete"

  text="Delete"

  press="onDelete">

</Button>

  <l:Grid

  defaultSpan="L12 M12 S12"

  id="gridId"

  width="auto">

  <l:content>

  <f:SimpleForm id="SimpleFormChange354"

  minWidth="1024"

  maxContainerCols="2"

  editable="true"

  layout="ResponsiveGridLayout"

  title="Address"

  labelSpanL="3"

  labelSpanM="3"

  emptySpanL="4"

  emptySpanM="4"

  columnsL="1"

  columnsM="1"

  class="editableForm">

  <f:content>

  <Label text="Amount" />

  <Input value="{Amount}" id="lm" />

  <Label text="Dates" />

  <Input value="{Dates}" id="lr" />

 

 

 

  <Button xmlns="sap.m"

  id="saveBtnId"

  text="save"

  type="Default"

 

 

  press="onSave">

 

</Button>

 

 

 

  </f:content>

  </f:SimpleForm>

  </l:content>

  </l:Grid>

Kapsel Offline App Error

$
0
0

Hi Experts,

 

I'm receiving an error while running a Kapsel Master Detail Offline App as a preview on Android Emulator and iOS Simulator.

 

iOS Simulator Error:

--> I can't find an error message in the WebIDE Console when im running it with the iOS Simulator

KapselOfflineErrorIOS.jpg

 

Android Emulator Error:

  • It's super slow compared to the iOS Simulator (I don't know if that matters)
  • It dosen't open the app on the emulated device
  • And I'm not getting any error message. It's not stopping at all.

 

 

Do you have any ideas?

 

Thank you,

Julia Haidn

Viewing all 6178 articles
Browse latest View live


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