NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Vic on November 19, 2012, 07:29:35 PM
-
Bruce,
I have a couple of questions.
1. Is the Net:f:filename limited to a physical file on the \web folder? Or is it possible to use In-memory driver to make it more dynamic? such as I can enter on the Text property of a display field of a webForm something like '<-- Net:f:' & p_web.GetSessionValue('sessionfile') & ' -->' ?
2. I'm looking for a way to send html thru a field on a form via a websource, however, I want the html script to be dependent on a value of an SQL table field, Is there a way to do it?
Thanks,
Vic
-
>> 1. Is the Net:f:filename limited to a physical file on the \web folder?
yes. the F tag is for files. And the files are always in web, or lower.
>> Or is it possible to use In-memory driver to make it more dynamic?
you can definitely use other tags to access data from a table. The most obvious is to use the name of a NetWebSource procedure which does whatever you like (including reading from a Memory table.)
>> such as I can enter on the Text property of a display field of a webForm something like '<-- Net:f:' & p_web.GetSessionValue('sessionfile') & ' -->' ?
Certainly you can generate your tags at runtime - you just need to get the right tag for what you are trying to do.
>> 2. I'm looking for a way to send html thru a field on a form via a websource, however, I want the html script to be dependent on a value of an SQL table field, Is there a way to do it?
sure, hand-code it in the netwebsource folder. ie open the table, read what you want, construct the html etc.
If you look at the generated source for a netwebsource it should be real easy (and obvious) of what to do.
cheers
Bruce
-
Bruce,
Ok, Got it. However, the timer gets affected and stops auto updating.
Thanks,
Vic
-
I think an example may help understand where you're at.
cheers
Bruce
-
Bruce,
Below is a sample code. Option 1 will stop the update by timer, while Option 2 will auto update.
SQLINQ{PROP:SQL}='SELECT RequestPending FROM TERMFILE Where Idle=2 AND DeviceNO=' & p_web.GetSessionValue('Ctr_No')
NEXT(SQLINQ)
IF NOT Errorcode()
p_web.SetSessionValue('loc:Status',SQLI:F1)
IF p_web.GetSessionValue('loc:Status')=1
p_web.SetSessionValue('SurveyStatus',1)
option 1-> packet= '<table><tr>Please press <a href="Vterm_Select.htm?Status=1"> here to begin </a>'
option 2-> packet= '<table><tr>Please press START button to begin.</tr></table>'
END
Do Sendpacket
END
Thanks,
Vic
-
my guess is the timer is failing because your html is not xhtml compliant.
watch it in the Firebug console and see.
cheers
Bruce
-
Bruce,
Will this technique of sending packets be limited to scripts related to updating fields on the page or can I have it jump to another page?
Thanks,
Vic
-
Bruce,
I finally got it to work using a NetWebSource procedure that I called from another websource. A direct packet send edited outside your xHTML container fails to compile with such error as misused '< >' or '{..}' or literal too long.
Cheers,
Vic