This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.sap.require("sap.ui.model.json.JSONModel"); | |
sap.ui.model.json.JSONModel.extend("myJSONModel", { | |
//declare our new method including two new parameters fnSuccess and fnError, our callback functions | |
loadDataNew: function(sURL, fnSuccess, fnError, oParameters, bAsync, sType, bMerge, bCache){ | |
var that = this; | |
if (bAsync !== false) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let's say you add into i18n.properties file | |
i18n.properties | |
message= Your viewig product {0} | |
jQuery.sap.formatMessage will format this | |
<ObjectAttribute text="{parts:[{path:'i18n>message'},{path:'ProductID'}], formatter: 'jQuery.sap.formatMessage'}"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:f="sap.ui.layout.form"> | |
<List headerText="{i18n>productListTitle}" items="{/ProductSet}"> | |
<ObjectListItem title="{Name}" intro="{ProductID}" | |
number="{ parts:[{path:'Price'},{path:'CurrencyCode'}], type: 'sap.ui.model.type.Currency', formatOptions: {showMeasure: false} }" | |
type="Active" press="onListItemPress" numberUnit="{CurrencyCode}" | |
numberState="{= ${Price} > 1000 &&${Price} < 1500 && ${CurrencyCode} ==='USD' ? 'Error' : 'Success' }"> | |
<ObjectAttribute text="{WeightMeasure} {WeightUnit}" visible="{= ${WeightMeasure} > 0 }" title="Weight"/> | |
<ObjectAttribute text="{Width} x {Depth} x {Height} {DimUnit}" visible="{= ${path:'CurrencyCode'} ==='EUR' ? true: false }"/> | |
<firstStatus> | |
<ObjectStatus text="{parts:[{path: 'WeightMeasure'},{path:'WeightUnit'}], formatter: '.formatter.deliveryStatus' }"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:f="sap.ui.layout.form"> | |
<List headerText="{i18n>productListTitle}" items="{/ProductSet}"> | |
<ObjectListItem title="{Name}" intro="{ProductID}" | |
number="{ parts:[{path:'Price'},{path:'CurrencyCode'}], type: 'sap.ui.model.type.Currency', formatOptions: {showMeasure: false} }" | |
type="Active" press="onListItemPress" numberUnit="{CurrencyCode}" | |
numberState="{= ${Price} > 1000 &&${Price} < 1500 && ${CurrencyCode} ==='USD' ? 'Error' : 'Success' }" | |
> | |
<firstStatus> | |
<ObjectStatus | |
text="{Price}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2009-2019 SAP SE or an SAP affiliate company. All rights reserved. | |
*/ | |
sap.ui.define(["sap/ui/comp/smartfilterbar/SmartFilterBar"], function(SmartFilterBar){ | |
"use strict"; | |
return SmartFilterBar.extend("retail.pmr.promotionaloffers.utils.controls.BorderlessSmartFilterBar", { | |
renderer: SmartFilterBar.getMetadata().getRenderer(), | |
onAfterRendering : function(){ | |
this.$().css({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sap.ui.define([], function() { | |
"use strict"; | |
return { | |
/** | |
* Rounds the currency value to 2 digits | |
* | |
* @public | |
* @param {string} sValue value to be formatted | |
* @returns {string} formatted currency value with 2 digits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sap.ui.define([ | |
"sap/ui/base/Object" | |
], function (BaseObject) { | |
"use strict"; | |
return BaseObject.extend("com.sodogan.Products.model.formatter.obj", { | |
/** | |
* @param {sap.ui.core.UIComponent} oComponent reference to the app's component | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyMainApp()); | |
} | |
class MyMainApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Dart samples: | |
To copy a list or map | |
use: | |
var myList = [...myBaseList]; | |
var myMap = {...myBaseMap}; | |
*/ | |
void main(List<String> args) { | |
Map<String, String> myBaseMap = <String, String>{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math' as math; | |
class Circle { | |
double _radius; | |
Circle({double radius=0.0}){ | |
this._radius = radius; | |
} |