question

Borja Lorenzo avatar image
0 Likes"
Borja Lorenzo asked Borja Lorenzo commented

How to create a popup window

Hello

I have a programmed GUI that performs an import from a database based on a given TimeStamp. Currently, I have programmed a notification in the Output Console. If no data is found in the SQL query executed through a preparedStatement, it notifies with a message that there is no data.

// Verificar si el ResultSet está vacío
int hasData = resultSet.fetchNext();
if (!hasData) {
    string errorMessage = "Error: No se encontraron datos para el timestamp: " + selectedTimestamp;
    print(errorMessage); // Mantener la salida en la consola
    showErrorPopup(errorMessage); // Mostrar el mensaje en una ventana emergente
    con.disconnect();
    return 0; // Asegurarse de que el return sea válido en FlexScript

In the same If statement where I see this, I would like to configure it to pop up a window in the center of the screen indicating this to the user, with an OK button that, when pressed, closes the window (or any other solution to close this pop-up window).

I know this event can be triggered through a User Command from this If statement, but I have no idea how to code this. Does the window need to be created beforehand and then made to appear with a command, or can it be created by code each time this condition occurs?

Currently, I use the command print() and the Output Console; however, I would like to learn how to create a popup window.

Thank you very much in advance for your comments.


FlexSim 24.1.1
flexscriptguiusercommandpopup
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Borja Lorenzo commented

You can use the msg() command for this.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Borja Lorenzo avatar image Borja Lorenzo commented ·
Thanks

It works perfectly

0 Likes 0 ·