on 12-19-2018 3:46 PM
screenshot-36-li.jpgscreenshot-37.pngscreenshot-38.pngHi guys,
So I have the following problem: We are developing an app. In that app you can look for certain objects by typing the ID of that object. My goal is that if you type in the number, but accidentally add a space (' ') or anything additional (letters etc.), which the number itself doesn't contain, it should still find the number and show the object to you.
Now our SAPUI Verison doesn't support ES6 so the arrow function doesn't work for me here. Is there any alternative to that so it works?
First screenshot you can see the code.
Second Screenshot is the dialog to type in and look for a certain number.
Third screenshot than is the object and the number.
I hope you can help me. Thanks!
In addition to my previous answer, I'd like to suggest, if applicable, to replace the TextArea control with the MaskInput:
content: new /*sap.m.*/MaskInput({ // Instead of TextArea
mask: "999999999999", // Max. 12 digits
placeholder: "Meldungsnummer eingeben"
}),
This would eliminate the need to filter out all non-digit characters (liveChange handler).
The "9" in MaskInput represents numbers by default.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> Now our SAPUI Verison doesn't support ES6 so the arrow function doesn't work
Sure, you can always replace arrow functions with function declarations like this:
arrsText.forEach(function(item, index) {
// ...
}.bind(this));
But the error indication in the code editor is not due to the lack of support by the framework but due to the missing ESlint parameter in your project settings which needs to be added:
With ES6 syntax, you now have to transpile the code before deploying as explained by Wouter's blog post (in case the target browser is not being actively developed, such as IE11) or apply this workaround to deploy the app without transpiling it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tatyana,
Check this blog, which will remove the eslint errors from webide
https://blogs.sap.com/2017/11/01/next-generation-javascript-in-ui5-using-sap-web-ide/
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.