Page tree
Skip to end of metadata
Go to start of metadata

The WaitCursor class handles the visibility of the following:

  1. waitCursor: rotating progress icon(loading spinner) for each SwatObject. It is displayed on it's parent panel and blocks clicking inside of the corresponding panel
  2. progressState: blocked pointer events on window container

It automatically triggers the waitCursor and/or progressState in the below use-cases: 

  1. The waitCursor and progressState is automatically fired when filtering on the BusinessEntity, on every fetch request. It also goes over the currently fetched businessEntity and applies the waitCursor on all controls linked to the same BusinessEntity. (DISPLAY, DATA TARGET links)
  2. The waitCursor and progressState is applied when launching a container, loading screens from the repository.
  3. The waitCursor is also triggered automatically when saving on a businessEntity until the save is successful or when an error is triggered while saving.
  4. The progressState is automatically cleared globally if a Javascript client logic error(event) is fired. So that in case of an error the window is not blocked in progressState.
  5. The progressState is also removed automatically when a http request fails 


akioma.invokeServerTask in CLAPI:

akioma.invokeServerTask handles the waitCursor by adding two new attributes.

In the case of showWaitCursor active, the uiContext SwatObject will be used for displaying the waitCursor and the waitState will be applied. 

Properties:

  • uiContext: The dynObject that should display the waitCursor. This object will also be used to find the container(window) and will apply the progressState on.
  • showWaitCursor: Boolean for activating or deactivating the waitCursor 


See below an example using akioma.swat.invokeServerTask with waitCursor active:

akioma.invokeServerTask example:
akioma.swat.App.invokeServerTask({
	name: 'ABC.Protokoll.ProtokollBT',
	methodName: 'ProtokollAusPapierkorb',
	paramObj: {
		plcParameter: ProtokollPapierkorbTaskParameter
	},
	showWaitCursor: true,
	uiContext: CallerWindow.dynObject
}).then(function(){
	akioma.swat.Message.displayMessageNum ( SmartMessageGroupNameEnum.OSCSYS, SmartMessageNumberEnum.DATENSATZ_ERFOGREICH_GESPEICHERT, { type:SmartMessageTypeEnum.success } );
});

 

Usage from CLAPI:

The WaitCursor can be used from ClientLogic by using the options showWaitCursor when calling akioma.invokeServerTask or by using the methods defined in akioma.swat.WaitCursor. 


akioma.swat.WaitCursor class examples to use from CLAPI:

An example that uses the waitCursor and progressState from ClientLogic is the dossier document viewer code.

In the Offer application the waitCursor is handled from CLIENT logic for the Offer new create dialog and for the wPrint dialog.


See below examples for using akioma.swat.WaitCursor class from CLAPI: 

// Method used to both show/hide the wait cursor and removing/adding the progress state blocking the user's pointer events in window container
akioma.swat.WaitCursor.hideWaitState(oDocViewer.dynObject);
akioma.swat.WaitCursor.showWaitState(oDocViewer.dynObject);
// Method used to show/hide the wait cursor
akioma.swat.WaitCursor.hideWaitCursor(oDocViewer.dynObject);
akioma.swat.WaitCursor.showWaitCursor(oDocViewer.dynObject);
// Method used for removing/adding the progress state blocking the user's pointer events in window container
akioma.swat.WaitCursor.showProgressState(oDocViewer.dynObject);
akioma.swat.WaitCursor.hideProgressState(oDocViewer.dynObject);
// Method returning given uiContext dynObject waitCursor visibility
akioma.swat.WaitCursor.isCursorVisible(uiContext);


// Method used for checking if progress state is active
akioma.swat.WaitCursor.isProgressStateActive(uiContext);


// Method used for checking if progress state is active globally on any window
akioma.swat.WaitCursor.isGlobalProgressStateActive()


Linking wait cursor with ExternalScreens


It is also possible to link the WaitCursor between external screens by calling the method linkExternalWaitState.

This will call the "ShowExternalWaitStates" and "HideExternalWaitStates" websocket events.

In the "ShowExternalWaitStates" and "HideExternalWaitStates" events the user receives the window id to be able to show/hide the wait state in the external screens.

Example setting the WaitCursor link in the external screen:

akioma.WaitCursor.linkExternalWaitState(uiContext, waitCursorWinId);

Example handling the events on linked wait cursor over WebSocket events:

akioma.socketConnection.on('ShowExternalWaitStates', (data) => {
		const winId = data.externalWindowId;
		const oWin = $.getObjectByName({ id: winId });

		if (!isNull(oWin)) {
			const oGrid = oWin.dynObject.getFirstChildByType('datagrid2').dynObject;
			akioma.WaitCursor.showWaitState(oGrid);
		}
});
akioma.socketConnection.on('HideExternalWaitStates', (data) => {
		const winId = data.externalWindowId;
		const oWin = $.getObjectByName({ id: winId });
		if (!isNull(oWin)) {
			const oGrid = oWin.dynObject.getFirstChildByType('datagrid2').dynObject;
			akioma.WaitCursor.hideWaitState(oGrid);
		}
});



Shortcut for cleaning up progressState globally:

SHIFT-ALT-CTRL-DEL


Will remove any active progressState, that is blocking the user from clicking inside of a window container.

akioma.WaitCursor

It's a static class, used for waitCursor and progressState functionality. The class provides methods like showWaitCursor, hideWaitCursor, showProgressState, hideProgressState, setProgressStateForLinks, createLogger and others.


debugMode - can be set to true or false and it’s used for the log level and for showing/hiding the blur on window in the progressState. If debugMode is true, than log.level is debug, else log.level is warn. Default is false

hasActiveProgressState - this property returns true or false depending if the progressState is on or off. Default is false.

showWaitCursor() - method for showing the loading cursor in the panel. accepts as a parameter the dynObject. 

showProgressState() - method for showing the progressState which will block the user from clicking on buttons inside the window/container object and show/hide blur depending on the debugMode property.


Showing the waitCursor on a businessEntity uiContext will automatically show the waitCursor for that businessEntity and its linked targets. Example:


 

On every fetch, the waitCursor and the progressState are triggered. Examples for sidebar:









  • No labels