SAP-archive / com.sap.openSAP.hana5.templates

openSAP HANA5 Software Development on SAP HANA (Q4/2016) Course Templates
https://open.sap.com/courses/hana5/
Apache License 2.0
24 stars 43 forks source link

fnLoadMetadata() doesn't triggered #7

Closed simjl closed 6 years ago

simjl commented 6 years ago

For the code snippet added by ex4_23, the call back method fnLoadMetadata() doesn't seem to be triggered.

But i noticed in your opensap video, there is a direct call to fnLoadMetadata() after attached it as a call back function: bpModel.attachMetadataLoaded(bpModel, function() { fnLoadMetadata(); }); fnLoadMetadata(); / direct call - missing line? /

Is this line missing ? Probably the metadataloaded event already triggred before the call back is attached. It works if i put the code into the promise version of metadataLoaded().then.

jung-thomas commented 6 years ago

Your right that this is different from the example implementation. And this is just to avoid async timing and assure the metadata is correct. I didn't necessarily want to get into the deeper concepts of things like promises. I've add this line to the template to make the example implementation.