Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9269

Re: Design Studio 1.3 SDK - Are script contributions for SAPUI5 method functions supported?

$
0
0

Mustafa,

 

I used your example code and was able to reproduce the error.  I am able to observe that the properties are being set out of order.  The showAlert property is set before the alertText1 and alertText2 properties.  This makes no sense, as you'd think that the server-side JS would honor order of execution, but my suspicion is that it does not dispatch a property update until the ZTL function has completed.  Further, if I am correct in that suspicion, I am unable to determine the order of those updates.

 

It's not alphabetical because I changed alertText1 to zlertText1 and observed the same mis-sequenced updates.

 

It appears that the bulk property updates use a last in, first out (LIFO) sequence.  I was able to change the order of your properties in contribution.xml to this, which will illustrate a proper working alertText1 and a broken alertText2:

 

<property id="alertText1" type="String" title="Alert Text 1" visible="false" />  <property id="showAlert" type="boolean" title="Show Alert" visible="false" />  <property id="alertText2" type="String" title="Alert Text 2" visible="false" />

If you were to move alertText2 before showAlert, then both will work in your example.

 

My guess is because this is server-side ZTL code, the updates to the properties occur in bulk once per "round-trip" aka execution, and the order is LIFO, which I personally thing is counter-intuitive, but if this suspicion is correct and by-design, at least we now know the reason for the behavior.

 

So you could either use my approach that gets around that, or use individual BIAL statements to set the alertText1, then alertText2, and then call the showAlert, but that seems unnecessarily overly verbose.

 

Of course this is all conjecture and assumptions on my part, so maybe Reiner Hille-Doering can weigh in and set us (or me) straight on what the best approach would be? 

 

Hope this helps, all the same!


Viewing all articles
Browse latest Browse all 9269

Trending Articles



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