NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: broche on April 30, 2014, 11:14:50 AM
-
NT 8.1
I have two fields on a form:
EditsRequired and EditsCompleted
I am trying to check one against the other when a check box is clicked with Immediate validation
I know the EditsRequired field = 1
But when I do a loc:alert it shows 0, even though the field is right there on the form.
Must be missing something here?
IF CVF:EditsCompleted => CVF:EditsRequired
Brian
-
Hi Brian
Try it like this
p_web.gsv('CVF:EditsCompleted') => p_web.gsv('CVF:EditsRequired')
Debra
-
Thanks Debra,
I sort of did it like that afterwards by doing the following which worked.
IF CVF:EditCommitt = 'Y'
Loc:EditsReq = p_web.GSV('CVF:EditsRequired')
Loc:EditsCompl = p_web.GSV('CVF:EditsCompleted')
DO CheckCounts
END
CheckCounts is a routine which does a lot and call other routines
Now the issue is getting the value in loc:EditsCompl back into CVF:EditsCompleted
I presume I use SetSessionValue something like
p_web.SetSessionValue('CVF:EditsCompleted','EditsCompl')
But this does not seem to work?
Brian
-
OK - I am confused as to what happens when
I have two routines in this same form which calculate the value of the document and the rates paid.
I have some logic in the same field as discussed that calls those routines
They get called OK but the form data does not get updated
When I call the routines from the PreUpdate embed after 1 start the routines work great, I also notice that this embed gets called as soon as the form is opened, so maybe I am using the wrong embed.
I am not using GSV etc. in this routine.
If I sound confused - I am :)
Brian.
-
Do you reset the field you need after calculations? (Server Side Tab)
-
Hi Brian
Once the Form and the values are displayed in the browser the connection with the server is broken and there is no rememberance on the server of status or values.
When the user completes a field and the value has been sent to the server the NT validation routine will place the value of that field into the file field so that in any 'server side code' you have access fo the file field and can include it in tests and computations. However, none of the other file fields are initialised until you code something like CVF:EditsRequired = p_web.GSV('CVF:EditsRequired') which moves the current value of the session variable into the field.
So if you are performing lots of calculations as part of the immediate code then for every field you are using you need the equivalent of the GSV above. There are also two commands that are useful in this context:
p_web.SessionQueueToFile(file) which primes a record buffer with contents from the session data queue and
p_web.FileToSessionQueue(file) which copies an entire file record buffer to the session data queue.
These are documented in Capesoft's 'Building Web Applications with NetTalk' book.
Cheers
Keith
-
p_web.SetSessionValue('CVF:EditsCompleted','EditsCompl')
But this does not seem to work?
You almost have it right, try it like this (notice no quotes in the second part)
p_web.SetSessionValue('CVF:EditsCompleted',EditsCompl)
So after you fix that, do what michelis said and make sure the items on the screen you want refreshed are listed in the "Reset" list. Find this right under your check box to "Send new value to server" where you enter your code.
-
Bruce's Webinar on May 1st answered a bunch of stuff relating to this issue.
Thanks Bruce.