NetTalk Central

Author Topic: Dates , Submit and memory form  (Read 3244 times)

willie53

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Dates , Submit and memory form
« on: July 30, 2012, 08:27:28 AM »
I am following the step to do the advance searching methods outlined by Bruce.

I got everything working, BUT I have a standard date field, and everytime I put information in the field for searching, it gets cleared out by the submit button.

All other fields String, Bytes are not cleared when I click on the submit button, and no the field is not duplicated anywhere else.

I created 3 fields  with dates and same thing happens.

Any idea as to whats going on? I'm tempted to think it has to do with the calendar look up button it automactically gets.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Dates , Submit and memory form
« Reply #1 on: July 30, 2012, 10:03:03 PM »
Hi Willie,

can you post a small example of the effect please?

cheers
Bruce

willie53

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Re: Dates , Submit and memory form
« Reply #2 on: July 31, 2012, 12:46:39 PM »
 ???
Hi Bruce,
I've attach the small demo reproducing the problem.!!

Thanks for you help on this..

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Dates , Submit and memory form
« Reply #3 on: July 31, 2012, 11:18:08 PM »
Hi Willie,

a couple things I noticed;
a) there was a compile error in the app, so I'm guessing you had the app open in the IDE when you zipped it up. However, hopefully, that won't matter.

b) you're using STOP statements to do debugging. this is _very_ bad in a web context because of the nature of the multi-threaded engine, and also because it causing timing complications in the browser. This is a good time to break this habit. Instead of STOP use
p_web._trace('whatever you like')
and view the results in DebugView.Exe (available from www.sysinternals.com, a microsoft division.)

c) you're using a "submit" button in a way which is unnecessary. In NT "submit" buttons are very rarely used (and I'd suggest "reset" buttons are almost never used.) In NT you can put the actual browse onto this memory form, and then have the browse update automatically whenever a search field has changed. Or, if you want a "search" button, you can certainly have one, just make it a "button" and refresh the browse when it's clicked.

d) You've got a bunch of code in the very first embed point for the form procedure (procedure setup). this means it'll get done _every_ time that procedure is called. (and it may interest you to know that the procedure is called 11 times by the time the submit button is pressed).

With regards to the date being cleared - you're doing it yourself in the call to "do ClearValues".
You have this code;
p_web.SetSessionvalue('Reset','Reset')
and then this code;
IF p_web.GetSessionValue('Reset') = 'Reset'
        Do clearvalues   
 
As an aside, what the example does show is that you're not really understanding the fundamental concepts behind how the form works. If I may be so bold, I recommend you get a copy of the NetTalk book
(http://www.capesoft.com/nettalkbook) - it'll go a long way to helping you get through the learning curve, and you'll save a lot of time figuring out stuff like this.

Which is not to say you won't figure it out without the book, just that it'll take longer.

Cheers
Bruce

willie53

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Re: Dates , Submit and memory form
« Reply #4 on: August 02, 2012, 12:29:29 PM »
Hi Bruce,
You are correct in the me not using the Stop statements, I had to put this together since it was tied to a very large SQL dictionary and I could not release that to you,
NOTE:   I saw we I had put in the clearing of the fields and for the life of me could not remember at the moment where and Why I did the clear values routines, i'm getting too dam old!!!
My apologies for screaming Wolf....

BUT, I put the procedure together following your exact intstructions ,granted it's a different of version of nettalk,  BUT I wanted to keep as close as possible to your example.
I do have a browse at the bottom but removed it since it was working correctly, I was only concerned with the main filter screen.


In your Advance Searching Example, you specifiy to use a submit button for both the search and reset buttons, and you also state to put the search build query in the procedure setup.

 >>> The Query and l:Reset fields are Submit buttons.  The l:Reset button is hidden if the l:Filter2 is blank, and displayed if it is filled in.  


>>>Notice that the URL will call the SAME PROCEDURE that I created.  Here is how that is possible.

>>>At the top of the procedure in the embed "Procedure Setup", the following code is added:

>>>l:Filter2 = p_web.GetSessionValue('CustomerFilter')
>>>  IF p_web.GetValue('cusaccount') <> ''
>>>     p_web.SetValue('l:Account',p_web.GetValue('cusaccount'))



And Yes, I do have your book and will review it to make sure I haved missed/forgotten etc... anything.:)

Thanks for your help!
« Last Edit: August 02, 2012, 04:03:11 PM by willie53 »

willie53

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Re: Dates , Submit and memory form
« Reply #5 on: August 02, 2012, 04:04:37 PM »
Bruce,

As you suggested, I started to reread the handbook, AND LOL.. you're explaing the same process but in a different manner..

Thanks for the advice...