NetTalk Central

Author Topic: NetWebForms - I think I'm missing something fundamental here  (Read 2228 times)

Neil Porter

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • Email
NetWebForms - I think I'm missing something fundamental here
« on: October 27, 2008, 06:34:34 AM »
I'm very new to NetTalk Web Server, so I apologise in advance if what I'm asking here is really dumb.

I have a scenario, where an end user will log into a NetTalk Web site, to book "jobs". To give this end user an estimated cost of this job prior to them submitting the job, I have added a GetPrice button to my NetWebForm with some embedded code attached to it, that I use in a standard clarion application elsewhere. (see attachment 1.jpg)

From looking at the documentation, and other posts on this forum, I thought that I would have to reference session variables in calculation code rather than the fields from my table, as I would do in a standard clarion form.

I’ve looked at a number of the example applications, but focussed on the Calculator mostly, as this seems similar in logic. (see attachment 2.jpg & 3.jpg for my embed code)

My problem is that my session variables don’t appear to be set when I call my calculation routine, unless I have used an unrelated lookup button elsewhere on my form. If I use this lookup, my session variables are populated with the variables that have been entered by the end user.

There is obviously a missing step somewhere in my logic, can anyone point me in the correct direction please.

TIA,

Neil Porter.

[attachment deleted by admin]
Clarion 11.0.13244
NetTalk 11.04

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: NetWebForms - I think I'm missing something fundamental here
« Reply #1 on: October 27, 2008, 06:45:47 AM »
Hi Neil,

You're on the right track.
First a direct answer to your question, then perhaps a suggestion.

a) The session values are only updated if the field has "Send new value to server" set. (ok, that's a lie, there are other times it will get updated anyway, but to be _sure_ that it is you should set the "Send New Value to Server" on).

So all your fields on the form, that affect the price, should have this ticked on.
Once that's done all the rest of the code is fine.

b) suggestion: If you are wanting to "fill all the fields in a record from the session queue" you can call
p_web.SessionQueueToFile(whateverfile)

c) Suggestion: It's possible to calculate the price "on the fly" without the user having to press the button. but I think you know that, and have chose to have the button. Doing it on the fly is more work for the server, but is _way_ cool for the user because they can see the effect of each change they make on the form.

Cheers
Bruce

Neil Porter

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • Email
Re: NetWebForms - I think I'm missing something fundamental here
« Reply #2 on: October 27, 2008, 07:33:18 AM »
Thanks Bruce, that nailed it  ;D

This is certainly an interesting learning curve, but the results are great once you get there. I'm having to think in a very different way to my normal clarion coding.

Is there a document that details all of these p_web methods that I've not found, or is that still work in progress? I don't want to keep posting things on here, and bugging you, if there are docs for me to read through first.

Cheers,

Neil.

Clarion 11.0.13244
NetTalk 11.04

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: NetWebForms - I think I'm missing something fundamental here
« Reply #3 on: October 27, 2008, 10:43:37 PM »
Hi Neil,

no theres no "technical doc" on the class methods yet...

Cheers
Bruce