It is currently 21 April 2025, 9:24 Advanced search

Message Box

Questions and answers on how to best use Instant Developer

Message Box

Postby john w » 12 September 2024, 15:15

I would like to have messages sent to the user if certain conditions exist. see image(s) Top is code the last is from Debug.

This are not appearing. Though debug seems to indicate they are. I have tested for empty strings and if the value isNull. Neither works. Can someone give the trick to getting this to appear.

Whats is curious I have another message later in the code that does appear.

Ashampoo_Snap_Thursday, September 12, 2024_10h4m48s.png
Ashampoo_Snap_Thursday, September 12, 2024_10h4m48s.png (18.09 KiB) Viewed 674 times
Attachments
Ashampoo_Snap_Thursday, September 12, 2024_10h12m42s.png
Ashampoo_Snap_Thursday, September 12, 2024_10h12m42s.png (26.19 KiB) Viewed 674 times
Regards

John W
User avatar
john w
 
Posts: 834
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Message Box

Postby t.simoncini » 12 September 2024, 15:24

Only one message box per request can be displayed.
The client message box component is only one. It will display only the first or the last (I don't remember) string set in the single request.
If you want multiple messages to appear, you need a custom multiple form created by you.
t.simoncini
 
Posts: 1585
Joined: 5 March 2012, 14:00

Re: Message Box

Postby john w » 12 September 2024, 15:29

Thanks! That explains the issue. I was thinking the messages would fire one after the other as the code was processed. Based on what is happening in my code it appears the last message is one that appears.

Now I just need to see if I can scheme out a solution.
Regards

John W
User avatar
john w
 
Posts: 834
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Message Box

Postby d.termini » 13 September 2024, 6:32

I concatenate the errors on a string like "error" + "\n" + "another error" and so on.
Then I test the variable, if there is a value I fire the message box.
d.termini
 
Posts: 1638
Joined: 13 November 2017, 8:41

Re: Message Box

Postby john w » 13 September 2024, 15:05

d.termini - Thanks for the suggestion. It is a more elegant process than the one I was considering which was to use the 'message' function. That worked but it not very attractive.
Regards

John W
User avatar
john w
 
Posts: 834
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Message Box

Postby john w » 14 September 2024, 14:21

Using d.termini suggestion was able to make something that will look far better to the user. Sometimes its the little things that can matter.
Regards

John W
User avatar
john w
 
Posts: 834
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Message Box

Postby d.termini » 16 September 2024, 7:46

:)
d.termini
 
Posts: 1638
Joined: 13 November 2017, 8:41


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 19 guests