cancel
Showing results for 
Search instead for 
Did you mean: 

VizFrame wait for data to load - renderComplete too soon

0 Kudos

Hey experts

I was wondering if there was any way you can wait for the vizframe to be on the screen. I used the following methods onAfterRendering en renderComplete. They both get called too soon. Usually the vizframe takes 3-5 seconds to load. But I can't use any form of timers. Anyone have any idea what I can use?

kind regards,

Matthijs

Accepted Solutions (1)

Accepted Solutions (1)

uladzislau_pralat
Contributor
0 Kudos

Hi Matthijs,

please try this:

oVizFrame3.getModel().attachRequestSent(function() { sap.ui.core.BusyIndicator.show(0); }); oVizFrame3.getModel().attachRequestCompleted(function() { sap.ui.core.BusyIndicator.hide(); });

Regards, Uladzislau

0 Kudos

This works too and is much shorter.

Thank you for answering.

Answers (1)

Answers (1)

0 Kudos
This is the method I used, if anyone knows any better way to check, please 
tell me
		waitVizRender: function(oVizFrame) {
			var bRendering = true;
			oVizFrame.addEventDelegate({
				onBeforeRendering: function() {
					if (bRendering === true) {
						sap.ui.core.BusyIndicator.show(0);
					}
				}
			}, oVizFrame);


			oVizFrame.addEventDelegate({
				onAfterRendering: function() {
					oVizFrame.getModel().attachRequestCompleted(function() {
						sap.ui.core.BusyIndicator.hide();
						bRendering = false;
					});
				}
			}, oVizFrame);
		}