NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: hilton on April 21, 2011, 06:10:17 PM

Title: two buttons(button) on a form (clarionV7.3)
Post by: hilton on April 21, 2011, 06:10:17 PM
Hi folks,

I have had two buttons(of type button) on a form for a while.  The first was to RELEASE a pending purchase order and the second to PRINT a copy of the purchase order.  In previous versions of Nettalk(up to about 17) the two functions would work fine. I have been away for some 8 weeks and upgraded to version 22.  Now only the first button(RELEASE) works when clicked.  I have noticed that for the second button(PRINT) that the routines Validate, ValidateValue and Value do not get called when clicked, but they do when RELEASE is clicked.  This means that embedded code (eg passing the PO number to print in a session variable) no longer works when the PRINT button is clicked.

Any ideas?

Thank you,
Hilton.
Title: Re: two buttons(button) on a form (clarionV7.3)
Post by: Bruce on April 22, 2011, 01:00:42 AM
very hard to say without an example Hilton.

cheers
Bruce
Title: Re: two buttons(button) on a form (clarionV7.3)
Post by: hilton on April 22, 2011, 10:36:34 PM
Hi Bruce,

I have noticed that if I put anything in the ONCLICK/URL or ONCLICK/PROCEDURE for either of the buttons, the Validate, ValidateValue and Value routines are not called.  That seems to be the change as compared with previous versions that I have used.  Of course, that may be intended, however, it has caught me out.

Bye,
Hilton.
Title: Re: two buttons(button) on a form (clarionV7.3)
Post by: hilton on April 22, 2011, 11:04:33 PM
Hi Bruce,

I added a few trace messages to web31 and found that using the ONCLICK/URL or  ONCLICK/PROCEDURE avoids calling routines Validate/ValidateValue/Value.  I did this just to make sure that I was not doing something crazy in my program.  This change is at the root of my current problem.

Thanks Hilton
Title: Re: two buttons(button) on a form (clarionV7.3)
Post by: Bruce on April 24, 2011, 10:29:57 PM
Hi Hilton,

Not sure that this has changed all that recently, but it's certainly possible that earlier "holes" have closed somewhat.

Yes, you're correct, if the button has a URL (or Procedure) to be called when the button is clicked, then the Validate::fieldname routine is not called. (In the past it's possible they were called, but as the two calls are handled on separate threads you cannot rely on the _order_ of the calls - they could complete in either order - so it's not a good way to write code.)

Cheers
Bruce