cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create wait circle in new UI

JoergAldinger
Active Contributor
0 Likes
309

Hello CCO devs!

We have a long running operation running in the background that should block the new CCO UI until it times out or returns.

Is there any way to display the native "wait circle" in the UI (maybe with a wait message?) to the cashier so he knows to wait for something?

Thanks and best regards,

Joerg.

Accepted Solutions (1)

Accepted Solutions (1)

R_Zieschang
Contributor

Hi joerg.ceo ,

you mean the wait circle for the cashier, right?

You are aware how to push events to the UI eventbus?

There are 4 events you can use:

"GLOBAL_LOADING_INDICATOR_SHOW",

"SHOW_GLOBAL_LOADING_INDICATOR",

and

"CENTER_LOADING_INDICATOR_HIDE",

"HIDE_CENTER_LOADING_INDICATOR".

Have a look at my answers here:

https://answers.sap.com/questions/12901101/example-for-a-quick-service-plugin-cco.html?childToView=1...

To get an idea how you can push messages to the ui eventbus in the ui itself.

It should look like something like this:

this.eventBus.push('GLOBAL_LOADING_INDICATOR_SHOW', "My custom message");

To push from your plugin backend maybe this will help.

https://answers.sap.com/questions/12843803/show-message-in-customer-checkout.html?childToView=128438...

So something like that:

JSONObject oJSONEventPayload = new JSONObject();
oJSONEventPayload.put("message", "my custom message");
UIEventDispatcher.INSTANCE.dispatchAction("GLOBAL_LOADING_INDICATOR_SHOW", null,
				oJSONEventPayload);

Never tested it though, let's us know if this works. 😉

Edit: shorter version for pushing event from backend.

Edit2: Changed Eventbus push.

Regards

Robert

JoergAldinger
Active Contributor

That worked perfectly, just a slight modification:

this.ccoEventBus.push('GLOBAL_LOADING_INDICATOR_SHOW', "My custom message" );

Thank you Robert!

Joerg.

Answers (0)