Posts

Showing posts from February, 2020

JS-Index of for-of Loop

Image
In ES6, loop with for-of is very convenient, but the only drawback is the missing index. But we can leverage array interator and destructuring to get looing index for us. for(let [iIndex,oSelected] of aSelected.entries()){ }

Be Careful when Using Method setDeferredGroups

There is a default batch group named 'Changes' for the v2 OData model. Method setDeferredGroups is used to set ( not add ) defer batch groups, which means calling this method will overwrite existing batch groups. Thus, if you don't want to impact existing groups, instead of calling this method directly, we'd better do below. oModel.setDeferredGroups([...oModel.getDeferredGroups(),"NewDeferredGroup"]); This is to append the new deferred group instead of removing existing groups.

Adjusting Received Messages after OData Calls

Image
When there is an error message you want to show to user is set as transition false as below(actually not a good example for real cases). This kind of message will not be displayed by UI5's message manager automatically. The reason is this message is parsed as persistent false. In order to display this automatically, we can change this attribute in the callback of OData calls. Then you see the error message as the left side.

Outdated Fiori Catalog in Customized Layer Leads to Tile Loading Error

Image
After creating a new app I added it to the existing Fiori catalog and everything looks familiar and good. But what happened after opening the Fiori Launchpad made me confusing for weeks. What I expected is the tile can be loaded by FLP and numeric data is loaded from backend service successfully. Unfortunately, this nice thing happened to all my clients except one, let's say client 100. In client 100, I saw something like below. First thought came up to my mind is the target mapping cache. Then I refreshed it via classical proven program '/UI2/INVALIDATE_CLIENT_CACHES' and '/UI2/INVALIDATE_GLOBAL_CACHES', and both have no any effects. After couples of hours debugger I found that in client 100, the newly added target mapping always failed to appear in the shared buffer(after re-building). Then I tried to re-generated PFCG roles by re-adding the catalog. No help again. So I turned back to Fiori Launchpad Designer again. Normally, when we add a new app, we always...