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

jQuery.sap.registerModulePath - How does it work?

$
0
0

Hi experts,

 

I would like to use a script from: crypto-js -   JavaScript implementations of standard and secure cryptographic algorithms - Google Project Hosting

 

I found this example File Names and Locations (View and Controller) - User Interface Add-On for SAP NetWeaver - SAP Library

 

My code:

 

jQuery.sap.registerModulePath("googlecode", "http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/");
jQuery.sap.require("googlecode.hmac-sha1");

In the Java Console, I get the message:

 

Uncaught Error: failed to load 'Twitter/controller/Master.controller.js' from ../controller/Master.controller.js: Error: failed to load 'googlecode/hmac-sha1.js' from http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/hmac-sha1.js: 0 - NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/hmac-sha1.js'.

 

even the Javascript can be found:

 

http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/hmac-sha1.js

 

who can help me?

 

KR


Linking Adobe Flex to SAPUI5

$
0
0

Hi Experts,

 

I am starting a new project wherein the existing application that is built using Adobe flex (as front end) needs some UI changes.

I am thinking to design the new screens using SAPUI5,upon already existing Flex code.

Can you please let me know the feasibility of linking Flex code to UI5 code?

 

Thanks,

Ashwini S

Change Datalabel value in Viz Bar chart

$
0
0

Hi All,

 

We have one issue. In UI5 viz bar chart, we want to change datalabel value. Instead of showing datalabel value, we want to show another value in that place but bar should be plotted for original value. I tried to change datalabel value in plotarea property, but it is not working. Please see the code below.

 

Data:

 

 

DEFECT_TYPEDATE_DIFFCOUNT
Noisy74

 

and the chart is:

 

S1.png

 

Code:

 

var oVizFrame = new sap.viz.ui5.controls.VizFrame("negativeChart", {

  height : "450px",

  width : "100%"

});

oVizFrame.setVizType('bar');

 

 

var oDataset = new sap.viz.core.FlattenedDataset({

  dimensions : [ {

  name : "Defect Type",

  value : "{DEFECT_TYPE}"

  } ],

  measures : [ {

  name : 'Avg Difference',

  value : '{DATE_DIFF}'

  }, {

  name : 'Count',

  value : '{COUNT}'

  } ],

  data : {

  path : "/DEFECT_COUNTS"

  }

});

 

 

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

oModel.setData(result);

oDataset.setModel(oModel);

oVizFrame.setDataset(oDataset);

oVizFrame.setModel(oModel);

 

 

 

 

var feedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({

  'uid' : "valueAxis",

  'type' : "Measure",

  'values' : [ "Avg Difference" ]

}), feedCategoryAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({

  'uid' : "categoryAxis",

  'type' : "Dimension",

  'values' : [ "Defect Type" ]

}), feedValueAxis2 = new sap.viz.ui5.controls.common.feeds.FeedItem({

  'uid' : "tooltip",

  'type' : "Measure",

  'values' : [ "Avg Difference", "Count" ]

})

 

 

oVizFrame.addFeed(feedValueAxis);

oVizFrame.addFeed(feedValueAxis2);

oVizFrame.addFeed(feedCategoryAxis);

 

 

oVizFrame.setVizProperties({

  general : {

  layout : {

  padding : 0.04

  }

  },

 

 

  plotArea : {

 

 

  dataPointStyle : {

  "rules" : [ {

  "dataContext" : {

  "Avg Difference" : {

  "min" : 6.1,

  "max" : 100

  }

  },

  "properties" : {

  "color" : "#4aa133",

  dataLabel : {

  text : "Count"

  }

  },

  "displayName" : "Avg Diff > 6"

  }, {

  "dataContext" : {

  "Avg Difference" : {

  "min" : 3.1,

  "max" : 6

  }

  },

  "properties" : {

  "color" : "#FFBF00"

  },

  "displayName" : "Avg Diff > 3 < 6"

  }, {

  "dataContext" : {

  "Avg Difference" : {

  "min" : 0,

  "max" : 3

  }

  },

  "properties" : {

  "color" : "#FF0000"

  },

  "displayName" : "Avg Diff > 0 < 3"

  } ],

  "others" : {

  "properties" : {

  "color" : "#FF0000"

  },

  "displayName" : "Avg Diff others"

  }

  },

 

 

  dataLabel : {

 

 

  visible : true,

 

 

  }

  },

 

 

  title : {

  visible : true,

  text : "Bar Chart"

  },

 

 

});

 

 

and the expected chart is as below. we want value of count (4) in place of 7 (date_diff column). But Chart should be for date_diff value only.

 

S2.png

 

can you please help to solve this issue?

 

 

Thanks,

Senthil

Two lists in a view

$
0
0

Hi Experts,

 

I have a requirement to show two lists one below the other with scrollbar for each of them. I tried using grid but I am not able to get the scrollbar for individual list. Please help.

 

Thanks,

Mansi

[50053] - Incomplete dimensions binding. error

$
0
0

Hi ,

 

     Please help me out to correct this error. I am getting  [50053] - Incomplete dimensions binding .

 

here is my code to fetch data from mysql. (it is fetching correctly) recived json data =

 

{"Details":[{"skill":"ABAP","count":"3"},{"skill":"BW","count":"2"},{"skill":"HANA","count":"1"},{"skill":"MEANSTACK","count":"1"},{"skill":"SAPUI5","count":"1"}]}


chart generating vizframe code  =



 

updateChart : function(){

  $.ajax({

       type:"post",

       dataType:"json",

       async:false,

       url:"http://localhost:8080/U-Plan/GetCompanyOverview",

       success:function(data)

       {

            alert('success data');

            var oModel = new sap.ui.model.json.JSONModel(data);

 

            var oDataset = new sap.viz.ui5.data.FlattenedDataset({

            'dimensions' : [ {

                      'name' : 'skill',

                      'value' : "{skill}"

            } ],

            'measures' : [

            {

                      'name' : 'count',

                      'value' : '{count}'

            } ],

            'data' : {

                      'path' : "/Details"

            }

       });

       var oVizFrame = sap.ui.getCore().byId("idoVizFrame1");

       oVizFrame.setDataset(oDataset);

       oVizFrame.setModel(oModel);

        // set feeds

        var feedPrimaryValues = new sap.viz.ui5.controls.common.feeds.FeedItem(

        {

                 'uid' : "primaryValues",

                 'type' : "Measure",

                 'values' : [ "Value" ]

         }), feedAxisLabels = new sap.viz.ui5.controls.common.feeds.FeedItem(

            {

                 'uid' : "axisLabels",

                 'type' : "Dimension",

                 'values' : [ "Category" ]

            });

 

            oVizFrame.addFeed(feedPrimaryValues);

            oVizFrame.addFeed(feedAxisLabels);

            oVizFrame.setVizType('column');    

            oVizFrame.setVizProperties({

            title : {

                 visible : true,

                 text : "Employee vs Technology",

            }

        });

 

        var chartPopover = new sap.viz.ui5.controls.Popover({});

        chartPopover.connect(oVizFrame.getVizUid());

 

       return;

       },

       error: function(data)

       { 

            alert('fail.');

       }

     });

  },

 

 

please find the attached error message...

SAPUI5 runtime context and browser refresh

$
0
0

Hi,

 

I observed the following behaviour: I created a navigation path and a number of models to be used in my App. The models are created in Component.js means centrally. I can easily access them from my MainView by this.getModel(). In the target View I am processing the model content. To access it there, I run

 

var oModelAnchor = sap.ui.getCore().byId(cModelAnchorViewID);
var oModelL = oModelAnchor.getModel(cModelName);

 

cModelAnchorViewID is the view ID of the main View and cModelName is containing the name of the model. Modeltype is JSON the viewtypes are XML and javascript. Code works fine as long as I use the implemented sapui5 navigation functionality.

 

As soon as I am refreshing the page, when I am on the target view by using the browser refresh button, the runtime context changes. My anchor view is not longer accessible and the first line of code is returning undefined. To work around the problem I declared the model locally to this view.

 

Any ideas why this happens? Obviously this behaviour is having significiant impact on how to implement value handling along navigation paths.

 

thanks for feedback.

 

WPdat

Filter Settings in ui5 table

$
0
0

Experts,

 

How can i add values of a column as settings for filter in responsive table control?

I am using settings button for my responsive table as in SAPUI5 Explored and wnat to filter the columns based on the values of column.

The table is successfully binded and settings button to call the fragment is also enabled. Now how do i assign the values of a column lets say weight values as check box for filtering ?

 

Appreciate your suggestions

List with with two standard list items navigation

$
0
0

Hi all,

 

i have sap.m.list which have a aggregation as sap.m.standard list item of type navigation. upon selection of a list item in this list it was navigating to other aggregation of sap.m.standard list item for the parent sap.m.list.

 

but the transition to second standard list item is not smooth. it does not have any animation . how can we achieve this.

 

below is my code.

In VIEW

 

oController.SelectionlistFiller = new sap.m.List("SelectionlistFiller",{

headerDesign : sap.m.ListHeaderDesign.Standard,

});

 

oController.SelectionlistFillertemplate = new sap.m.StandardListItem({

  title :"{Depname}",

  description:"{Depid}",

  type : sap.m.ListType.Navigation,

  press: oController.selectListedItemFiller

  

 

});

 

oController.SelectionlistinsideFillertemplate= new sap.m.StandardListItem({

  title :"{subDeptname}",

  description:"{SubDeptid}",

  type : sap.m.ListType.Active,

  press: oController.selectListedIteminnerFiller

});

 

 

 

in controller.

 

 

selectListedItemFiller:function(oEvent){

  Controller.CLOSSelectionlistFiller.bindAggregation("items",oEvent.getSource().getBindingContext().sPath+"/SubDept/results",Controller.SelectionlistinsideFillertemplate);

 

  }

 

selectListedIteminnerFiller :function(oEvent){

 

  Controller.SelectionlistFiller.removeAllAggregation();

  Controller.SelectionlistFiller.bindAggregation("items","/results",Controller.SelectionlistFillertemplate);

 

  },

,

 

basically its a deep entity odata which has the dept and sub dept values.

 

So is there any way the transition to have a animation.

 

Thanks

Prasad


Checkboxes in ui5

$
0
0

Hi,

 

I have 2 checkboxes on the screen(checkbox1,checkbox2), my requireemnt is to by default checkbox1 is selected, which is done . now when checkbox2 is selected then checkbox 1 gets unchecked , and vice a versa.

 

code i m writting for the same is :

 

// create a simple CheckBox

  new sap.ui.commons.CheckBox({

  id : "checkbox1",

  text : "checkbox1",,

  tooltip : 'Commercial Customer',

  checked : false,

  enabled : true,

  change : function(){

  alert("commercial selected");

  sap.ui.getCore().byId("checkbox2").setChecked(false);

  }

 

new sap.ui.commons.CheckBox({

id : "checkbox2",

checked : true,

enabled : true,

change : function(){

alert("residentail selected");

sap.ui.getCore().byId("checkbox1").setChecked(false);

 

}

 

Alers are coming but the toggling of the checkboxes are not working.

Secondly in additons to this I have to make some fields visible or hidden.

 

Thanks in advance

 

Pooja

creating a treetable and reading the data from local xml.

$
0
0

Hi All,

Can anyone please provide an example of tree table which reads the data from a local xml file.

 

And in a page, I am trying to add smart filter bar with tree table.

Shall I need to create 2 views and controllers for this.

Is it possible to add both smart filter bar and tree table in one view with one controler.

 

Please help me?

 

Regards,

Kamaljit Singha

Method 'HEADERSET_GET_ENTITYSET' not implemented in data provider class

$
0
0

hi all,

i want to implement LORD_ODATA_ORDER_SRV odata service.i deploy to resportory in SAP system.and execute.But method 'HEADERSET_GET_ENTITYSET' not implemented in data provider class.How can i implement HEADERSET_GET_ENTITYSET method?

e1.PNG

e2.PNGe3.PNG

Adding Footer to the sap.ui.table.Table

$
0
0

Hi,

I want to add footer to the sap.ui.table.Table.

As sap.ui.table.Column doesn't have aggregation 'footer' like sap.m.Column

Like using sap.m.Column we can add footer to the sap.m.Table.

 

NameCity                                    Allotted AmountExpense
ABCXYZ1000500
DEFXYZ2000500
GHIXYZ3000500
Total                                60001500

 

Something similar to above. Total must be below its column's footer area.

 

Can anybody have some pointers on this?

 

Thanks,

Rahul Naiknaware.

Displaying Table for a specific date in calendar

$
0
0

Hi Experts,

 

 

My requirement is to display a calendar in my xml view. On clicking a specific date a table should be displayed.

So far I have been able to display the calendar using the SAPUI5 Explored help. But I'm struck with displaying the table. I am new to UI5 development. Please provide your valuable suggestions.

 

 

Thanks,

Srinivasan.S

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

Upload Collection

$
0
0

Hello Experts

 

did any one tried using upload collections control that is available in sapui5 explored site

SAPUI5 Explored

I Couldn't upload the files after selecting the upload button. setUploadurl method is not setting the url to the collection control, so the upload function is always trying to call the localhost/upload. apart from following the same code in the example, I added code for crf token and setUploadurl method. Could you pleae let me know if I miss anything

 

 

thanks!


Best practice to share formatter.js between custom Fiori?

$
0
0

Is there a best practice to share formatter.js between custom Fiori?

 

Two solutions that came to my mind are:

  • extending a template Fiori, having the formatter.js to share
  • including the formatter.js as a external JavaScript lib

 

Do you have other suggestions? Thank you!

Rerendering custom control

$
0
0

Hi guys,

 

     I'm wondering how can my custom control can be rerender after model changes ? I think i'm doing it wrong : on this exemple my button is rerender after model changes but not my custom control.

 

<Button text="{/ymax}" />
<controls:pool id="myPool" items="{/}"  title="{/ymax}" press="test" refresh="changeModel" />

 

 

Thanks in advance,

Rick

Is there an overview for data binding terminology?

$
0
0

To be honest, I feel overwhelmed by the data binding terminology in SAPUI5 / Fiori.

 

 

I am looking for definitions or complex guides. The SAP online documentations are not enough for all my questions. What I am looking for a defintiions for:

 

  • path
  • binding
  • property
  • context
  • context binding
  • aggregation binding
  • element binding
  • property binding
  • ... and more?

 

I am very helpfull for links to sources or an answer here. Thank you!

How to detect an expired NetWeaver session

$
0
0

Hello

 

I use SAPUI5 with SAP NetWeaver AS Java and have some security constraints for my SAPUI5 app to require some NetWeaver roles to access the application.

 

When launching the xApp for the first time, I have to sign in to NetWeaver to access the xApp.

 

However, after some time (= timeout), my session timed out and I was forced to login again. This works just fine, when pressing F5 to reload the page.

 

The strange this happens when SAPUI5 tries to load some resources (like additional views, controllers or other classes), but my session already expired. SAPUI5 tries to load the view, evaluates the code and throws an error as it doesn't get the SAPUI5 code but the NetWeaver login mask.

 

Is SAPUI5 able to detect an expired session?

 

Regards

Tobias

SAP Web IDE search field

$
0
0

Hi Expert,

 

I'm new to sap web ide. I'm exploring on how to create a custom app.

I hit an issue on the search function. I used the layout editor on the master view and select the search bar. Why the data set drop down box is grey out and not allow me to define my data set? I'm able to define in my {Description} field. Where did I missed out?

1.png

 

Regards,

-Ben-

Viewing all 6178 articles
Browse latest View live


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