Package com.apgar.common.lib.utils
Class UserServiceUtils
java.lang.Object
com.apgar.common.lib.utils.UserServiceUtils
Utility class providing methods for displaying loading indicators, error messages, and managing user service interactions in a web
interface.
- Author:
- Apgar Consulting
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddisplayIframeDivAndRefreshOnButtonClick(UserServiceWriter writer, String buttonId, String divId) Displays a specific div element and refreshes its content when a button is clicked.static voidhideMainDivAndShowWaitOnClick(UserServicePaneWriter writer, String submitButtonId, String waitDivId, String mainDivId) Shows a loading screen and hides a specific div when the user clicks a designated button.static voidsetInputEventListenerJS(UserServicePaneWriter aWriter, String inputElementId, String functionToTrigger) Sets an event listener for an input element to trigger a specified function on Enter key press.static voidSynchronizes the height of an iframe with its parent window.static voidwriteDisplayWaitJs(UserServiceWriter writer, String divId) Displays the loading div element in the user interface using JavaScript.static voidwriteError(UserServicePaneWriter writer, String divId, String message) Displays an error message in the center of the screen.static voidwriteExportValidationWait(UserServicePaneWriter writer, String divId, String message) Displays a loading sign during the export validation process with a custom message.static voidwriteHideDivJs(UserServiceWriter writer, String divId) Hides the specified div element using JavaScript.static voidwriteHideWaitJsIFrame(UserServiceWriter writer, String divId) Hides the loading div element in an iframe context, depending on the current user session.static voidwriteHideWaitJsWsIFrame(UserServiceWriter writer, String divId) Hides the loading div element in a specific iframe context.static voidwriteWait(UserServicePaneWriter writer, String divId) Displays a loading sign in the center of the screen.static voidwriteWait(UserServicePaneWriter writer, String divId, String message) Displays a loading sign in the center of the screen with a custom message.
-
Method Details
-
writeWait
Displays a loading sign in the center of the screen.- Parameters:
writer- theUserServicePaneWriterused to write the loading signdivId- the ID of the div element where the loading sign will be displayed
-
writeWait
Displays a loading sign in the center of the screen with a custom message.- Parameters:
writer- theUserServicePaneWriterused to write the loading signdivId- the ID of the div element where the loading sign will be displayedmessage- the message to display alongside the loading sign
-
writeExportValidationWait
public static void writeExportValidationWait(UserServicePaneWriter writer, String divId, String message) Displays a loading sign during the export validation process with a custom message.- Parameters:
writer- theUserServicePaneWriterused to write the loading signdivId- the ID of the div element where the loading sign will be displayedmessage- the message to display alongside the loading sign
-
writeError
Displays an error message in the center of the screen.- Parameters:
writer- theUserServicePaneWriterused to write the error messagedivId- the ID of the div element where the error message will be displayedmessage- the error message to display
-
writeDisplayWaitJs
Displays the loading div element in the user interface using JavaScript.- Parameters:
writer- theUserServiceWriterused to add JavaScript codedivId- the ID of the div element to display
-
writeHideDivJs
Hides the specified div element using JavaScript.- Parameters:
writer- theUserServiceWriterused to add JavaScript codedivId- the ID of the div element to hide
-
writeHideWaitJsIFrame
Hides the loading div element in an iframe context, depending on the current user session.- Parameters:
writer- theUserServiceWriterused to add JavaScript codedivId- the ID of the div element to hide
-
writeHideWaitJsWsIFrame
Hides the loading div element in a specific iframe context.- Parameters:
writer- theUserServiceWriterused to add JavaScript codedivId- the ID of the div element to hide
-
syncIframeHeightWithParent
Synchronizes the height of an iframe with its parent window.- Parameters:
writer- theUserServiceWriterused to add JavaScript code
-
displayIframeDivAndRefreshOnButtonClick
public static void displayIframeDivAndRefreshOnButtonClick(UserServiceWriter writer, String buttonId, String divId) Displays a specific div element and refreshes its content when a button is clicked.- Parameters:
writer- theUserServiceWriterused to add JavaScript codebuttonId- the ID of the button that triggers the display and refreshdivId- the ID of the div element to display
-
hideMainDivAndShowWaitOnClick
public static void hideMainDivAndShowWaitOnClick(UserServicePaneWriter writer, String submitButtonId, String waitDivId, String mainDivId) Shows a loading screen and hides a specific div when the user clicks a designated button.- Parameters:
writer- theUserServicePaneWriterused to add JavaScript codesubmitButtonId- the ID of the submit buttonwaitDivId- the ID of the waiting div to displaymainDivId- the ID of the main div to hide
-
setInputEventListenerJS
public static void setInputEventListenerJS(UserServicePaneWriter aWriter, String inputElementId, String functionToTrigger) Sets an event listener for an input element to trigger a specified function on Enter key press.- Parameters:
aWriter- theUserServicePaneWriterused to add JavaScript codeinputElementId- the ID of the input element to listen for eventsfunctionToTrigger- the JavaScript function to call when Enter is pressed
-