NetTalk Central

Author Topic: Conditional show message when saving record  (Read 170 times)

Poul Jensen

  • Full Member
  • ***
  • Posts: 125
    • View Profile
    • Email
Conditional show message when saving record
« 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
« Last Edit: May 28, 2019, 06:48:23 AM by Poul Jensen »

Poul Jensen

  • Full Member
  • ***
  • Posts: 125
    • View Profile
    • Email
Re: Conditional show message when saving record
« Reply #1 on: May 28, 2019, 06:48:56 AM »
Anybody ?

/Poul

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9633
    • View Profile
Re: Conditional show message when saving record
« Reply #2 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

Poul Jensen

  • Full Member
  • ***
  • Posts: 125
    • View Profile
    • Email
Re: Conditional show message when saving record
« Reply #3 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

« Last Edit: May 28, 2019, 08:08:50 AM by Poul Jensen »

Poul Jensen

  • Full Member
  • ***
  • Posts: 125
    • View Profile
    • Email
Re: Conditional show message when saving record
« Reply #4 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
« Last Edit: May 28, 2019, 11:08:29 AM by Poul Jensen »

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 300
    • View Profile
    • Email
Re: Conditional show message when saving record
« Reply #5 on: May 29, 2019, 03:35:52 AM »
Hi Poul

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

Regards Niels

peterH

  • Sr. Member
  • ****
  • Posts: 360
    • View Profile
Re: Conditional show message when saving record
« Reply #6 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 ;-)
« Last Edit: May 29, 2019, 05:27:40 AM by peterH »

Poul Jensen

  • Full Member
  • ***
  • Posts: 125
    • View Profile
    • Email
Re: Conditional show message when saving record
« Reply #7 on: May 29, 2019, 05:02:57 AM »
Hey Niels,

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

/Poul

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 300
    • View Profile
    • Email
Re: Conditional show message when saving record
« Reply #8 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

peterH

  • Sr. Member
  • ****
  • Posts: 360
    • View Profile
Re: Conditional show message when saving record
« Reply #9 on: May 30, 2019, 02:55:47 AM »
Hi Niels,

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

Peter