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(com.orchestranetworks.userservice.UserServiceWriter writer, String buttonId, String divId) Displays a specific div element and refreshes its content when a button is clicked.static voidhideMainDivAndShowWaitOnClick(com.orchestranetworks.userservice.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(com.orchestranetworks.userservice.UserServicePaneWriter aWriter, String inputElementId, String functionToTrigger) Sets an event listener for an input element to trigger a specified function on Enter key press.static voidsyncIframeHeightWithParent(com.orchestranetworks.userservice.UserServiceWriter writer) Synchronizes the height of an iframe with its parent window.static voidwriteDisplayWaitJs(com.orchestranetworks.userservice.UserServiceWriter writer, String divId) Displays the loading div element in the user interface using JavaScript.static voidwriteError(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId, String message) Displays an error message in the center of the screen.static voidwriteExportValidationWait(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId, String message) Displays a loading sign during the export validation process with a custom message.static voidwriteHideDivJs(com.orchestranetworks.userservice.UserServiceWriter writer, String divId) Hides the specified div element using JavaScript.static voidwriteHideWaitJsIFrame(com.orchestranetworks.userservice.UserServiceWriter writer, String divId) Hides the loading div element in an iframe context, depending on the current user session.static voidwriteHideWaitJsWsIFrame(com.orchestranetworks.userservice.UserServiceWriter writer, String divId) Hides the loading div element in a specific iframe context.static voidDisplays a loading sign in the center of the screen.static voidwriteWait(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId, String message) Displays a loading sign in the center of the screen with a custom message.
-
Method Details
-
writeWait
public static void writeWait(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId) 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
public static void writeWait(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId, String message) 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(com.orchestranetworks.userservice.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
public static void writeError(com.orchestranetworks.userservice.UserServicePaneWriter writer, String divId, String message) 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
public static void writeDisplayWaitJs(com.orchestranetworks.userservice.UserServiceWriter writer, String divId) 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
public static void writeHideDivJs(com.orchestranetworks.userservice.UserServiceWriter writer, String divId) Hides the specified div element using JavaScript.- Parameters:
writer- theUserServiceWriterused to add JavaScript codedivId- the ID of the div element to hide
-
writeHideWaitJsIFrame
public static void writeHideWaitJsIFrame(com.orchestranetworks.userservice.UserServiceWriter writer, String divId) 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
public static void writeHideWaitJsWsIFrame(com.orchestranetworks.userservice.UserServiceWriter writer, String divId) 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
public static void syncIframeHeightWithParent(com.orchestranetworks.userservice.UserServiceWriter writer) Synchronizes the height of an iframe with its parent window.- Parameters:
writer- theUserServiceWriterused to add JavaScript code
-
displayIframeDivAndRefreshOnButtonClick
public static void displayIframeDivAndRefreshOnButtonClick(com.orchestranetworks.userservice.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(com.orchestranetworks.userservice.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(com.orchestranetworks.userservice.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
-