NetTalk Central

Author Topic: Message box  (Read 6999 times)

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Message box
« on: February 20, 2012, 02:48:50 AM »
Hi Guys,

Is it possible to display a dialoque message box to the user from my web-application?
I looked at the message box example, but it requires an additional template.
Can a simple Java message box be called?

Regards
Rupert

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Re: Message box
« Reply #1 on: February 20, 2012, 05:12:40 AM »
Hi Rupert.

You can simply show message to the user using javascript method for example:

p_web.Script('alert(''xxx'');') where xxx is the string which You want to show to the user.

Regards,
Matthew

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Re: Message box
« Reply #2 on: February 22, 2012, 05:25:45 AM »
Thanks Matthew, the popup message is working ...

I'd like to display the message after the user clicked FINISH in the NetWebForm(Wizard)
Source = Memory.

I tried the ValidateAll embed, but crashes the page as soon as the message is called.
I guess it's because the thread is already closed at this point ..?

Is there a spot that I can include p_web.Script('alert(''xxx'');')
.. after the user clicked the FINISH button?
« Last Edit: February 22, 2012, 05:38:38 AM by rupertvz »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Message box
« Reply #3 on: February 22, 2012, 05:38:56 AM »
only in very limited cases (if the wizard is a popup).
Otherwise the Finish button is fetching a new page, so you need to embed the script in that page you are going to.

cheers
Bruce

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Re: Message box
« Reply #4 on: February 22, 2012, 05:49:39 AM »
Thanks Bruce,

At the moment I am using some code (for record updates) in the ValidateAll embed of the wizard.
Thereafter I am redirecting to another page ...

Using:  p_web.redirect('http://www.domain.com/page.htm')

I am considering to first call another "blank-message" HTML page on my server, before redirecting to the external URL. 

Is "p_web.redirect" the best way to call a subsequent page on my server from the ValidateAll embed of the wizard?

ian.burgess

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Message box
« Reply #5 on: February 22, 2012, 06:14:36 AM »
You can simply show message to the user using javascript method for example:

p_web.Script('alert(''xxx'');') where xxx is the string which You want to show to the user.

What if you want to set values of buttons and perform code based on the user's response in the same way as a standard message() in Clarion?

Ian

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Message box
« Reply #6 on: February 22, 2012, 06:29:39 AM »
Then you are either coding a javascript prompt box or calling a ntws form page to process the request.
Look here for javascript -> http://www.w3schools.com/js/js_popup.asp

HTH
Chris
Real programmers use copy con newapp.exe

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Message box
« Reply #7 on: February 22, 2012, 05:21:33 PM »
Hi Ian,

although you might be able to achieve what you want via some Javascript, it is one of the probs I had to overcome converting an win app to the web.

Where I would have messagebox warnings to the user (like during posting a batch of invoices) I now just log them and display them as HTML which is actually nicer than the user having to click through a whole bunch of messages. Other messages where the user had a choice of what to do I add some check boxes to the form which they can tick before they click the post button and others I just make the decision for the user.

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Re: Message box
« Reply #8 on: February 22, 2012, 10:37:31 PM »
Hi Guys,

With reference to my post above,

I'd like to call a new page inside my app (newpage.htm) from a NetWebForm(Wizard) procedure.
From the ValidateAll embed point.

Is "p_web.redirect" the best way to call a subsequent internal page?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Message box
« Reply #9 on: February 23, 2012, 12:38:10 AM »
>> Is "p_web.redirect" the best way to call a subsequent page on my server from the ValidateAll embed of the wizard?

The short answer is no. PostInsert, or PostUpdate would be better.

the longer answer is that you shouldn't be redirecting at all. The Finish button should take you to a known place, set when the form is created. That place (usually a page, or memory form) can be set to make a choice as to what to then display.

cheers
Bruce

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Re: Message box
« Reply #10 on: February 23, 2012, 01:42:53 AM »
Thanks Bruce,

But I have quite significant code in the ValidateAll embed, which I can't go without.
As previously discovered, when I let the Wizard go to the "new-page" automatically, it discards the code in ValidateAll.

Any other way?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Message box
« Reply #11 on: February 23, 2012, 05:44:01 AM »
ValidateAll runs before PostInsert or PostUpdate. So the code there would still exist.

cheers
Bruce

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Re: Message box
« Reply #12 on: February 23, 2012, 01:18:16 PM »
Hi Bruce,

The wizard source is from memory,

Does PostInsert and PostUpdate still apply?

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Message box
« Reply #13 on: February 23, 2012, 02:48:05 PM »
If I'm not sure of something, I add a p_web._trace('bla bla') and see what happens in debugview when I run my app.

Adding a trace to ValidateAll, PostInsert and PostUpdate you will be able to answer your own questions!