NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Poul Jensen on April 17, 2019, 01:32:58 AM

Title: Conditional show message when saving record
Post by: Poul Jensen on April 17, 2019, 01:32:58 AM
Hi,

When I save a record I would like conditionally to show a message.
In the embed Complete Form / 3 End I do some processing and after that I would like to show a pop-up message.

It could also be in embed End of Procedure / After Closing Files.

How to do this ?

Cheers
/Poul
Title: Re: Conditional show message when saving record
Post by: Poul Jensen on May 28, 2019, 06:48:56 AM
Anybody ?

/Poul
Title: Re: Conditional show message when saving record
Post by: Bruce on May 28, 2019, 07:12:08 AM
are we talking about a popup closing here or a page-form?
I think it's more or less possible to do with a popup, it would be very difficult to do with a page.

Generally speaking though, the form has "closed" and the user is going to another page. Yes you are doing some code on the server side, but you'd need to add the message to the "place you are going to" because the "place you are coming from" has already disappeared.

cheers
Bruce
Title: Re: Conditional show message when saving record
Post by: Poul Jensen on May 28, 2019, 07:52:31 AM
Hi Bruce,

I have completed a form and saved the content.
Based on a local variable or session variable I need to show a message to the user (or not show a message).

Maybe this could be done earlier on the form.  When the user clicks SAVE the message could be shown.  But I guess not an ALERT since we need to save the form.

/Poul

Title: Re: Conditional show message when saving record
Post by: Poul Jensen on May 28, 2019, 10:55:09 AM
Hi again,

I have solved it using a loc:Alert message in the Completed Form embed.

/Poul
Title: Re: Conditional show message when saving record
Post by: Niels Larsen on May 29, 2019, 03:35:52 AM
Hi Poul

Why not use the p_web.showInfo('Hello World')?

Regards Niels
Title: Re: Conditional show message when saving record
Post by: peterH on May 29, 2019, 04:54:13 AM
Hi Niels,

Sorry for interrupting, but are there any restrictions on where you can use that? I've never managed to get it to work.

Peter

Update: Hmm - setting pTimer to a big number makes a difference ;-)
Title: Re: Conditional show message when saving record
Post by: Poul Jensen on May 29, 2019, 05:02:57 AM
Hey Niels,

That was just what I was looking for.  Works perfectly in my situation :-)

/Poul
Title: Re: Conditional show message when saving record
Post by: Niels Larsen on May 30, 2019, 01:10:27 AM
@Peter

I use it everywhere. In my header I have tre divs styled as one in red, one in yellow and one in green. By default they are hidden (display:none) and when you call the showinfo there is a third parameter takes which div-id you want to show it in.
In the second parameter you can set a timeout.
Very useful

REgards Niels
Title: Re: Conditional show message when saving record
Post by: peterH on May 30, 2019, 02:55:47 AM
Hi Niels,

Finally I'm seeing the light, thank you very much!

Peter