NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - GordonF

Pages: 1 [2]
16
Web Server - Ask For Help / Odd lookup behaviour
« on: September 07, 2021, 07:31:15 AM »
Using NT 12.17

I have a form that allows a client record to be attached to a record in one of 2 ways, either select from an existing list (lookup) or add one on the fly that gets saved to a separate table to be validated later by another user.

So the form has a radio choice of existing or new then:

If new there are a selection of client fields to be entered manually including a drop list for titles from a Titles table (work perfectly)

If existing is selected an existing client a drop list is displayed and the client related entry fields become read only to display the selected client details. Again it all works perfectly, well most of the time on odd occasions the client fields are cleared after selection. I have narrowed this down to a drop list field, in this case the client title which is file loaded drop list (actually set to read only if existing client).

Here is a snippet of code from the Validate::lvClientCode Routine with the extra assign fields, the drop list field is lvClientTitleGUID. When the error occurs all the fields after lvClientTitleGUID in the list are blank, so if I moved it down several lines the fields above populate correctly, unfortunately I can't move it any lower than just before the pushevent so the clientcode is blanked. I have changed it to a queue loaded drop and all is well, could it relate to the fact that the title field drop value::.. routine opens and closes all the files including clients?

  p_Web.SetValue('lookupfield','lvClientCode')
  do AfterLookup
  do Refresh::lvClientTitleGUID
  do Refresh::lvClientSurname
  do Refresh::lvClientFirstname
  do Refresh::lvClientDoB
  do Refresh::lvClientGender
  do Refresh::lvClientAddr1
  do Refresh::lvClientAddr2
  do Refresh::lvClientAddr3
  do Refresh::lvClientAddr4
  do Refresh::lvClientAddr5
  do Refresh::lvClientPostcode
  do Refresh::lvClientHomePhone
  do Refresh::lvClientMobilePhone
  do Refresh::lvClientEmail
  p_web.PushEvent('parentupdated')
  do Refresh::lvClientCode   ! Field is auto-validated
  do SendMessage
  p_web.ntForm(loc:formname,'ready')
  p_web.PopEvent()

I hope someone can shed some light, if not I'll try to modify an example to recreate the problem, however it is very intermittent.

Gordon

17
My requirement is to be able to ask a session's webhandler to show a message page, however I want to do this not in response to user interaction but from a separate process in the webserver application, possibly using the webserver class methods.

In effect I'd like to cause something like this to be executed:

p_web.Script(p_web.WindowOpen('MyMessagePage'))

Given I will have the specific SessionID is there any way from the WebServer class to

1. set a session value for a specific session using the SessionID, there appears to be a possible method _SetSessionValue, however I'm unsure of it's usage.
2. send the session's webhandler an event or in some other way communicate with it to cause it to execute some code.

I'm aware that the message page will only be shown if the user has the browser page open and the session is still active.

Any enlightenment gratefully received.

Gordon

18
I think this is a question for Bruce but please feel free to comment.

A while back I posted a message about record locking (not literally) in a multi user system. The strategy that I proposed and Bruce clarified is working out ok so far, however I have one issue I'd like comments on please.

The record locking actually places records in a lock table and is in effect soft locking, under normal circumstances the locks get cleared, such as record update, update cancel, user logout and session timeout. However I do get occasional locks that don't get cleared due to people navigating away from an update in their browser, they stay in the product but the page never gets completed or cancelled so the lock never gets deleted.

I can only think of two ways to tackle this:

1. Detect the user has navigated away from the update page, they may have pressed the browser back button or closed the tab, unfortunately I don't know how to do this

2. I add a SessionID and DateTimeStamp to the lock records, so I can have a housekeeping task that clears old locks, that's easy I just have a thread running that bins locks older than a certain number of minutes, crude but it works. However I would like to also check for locks with sessionids that are no longer active in case any tidy up was missed. The way I've done this is to get a list of unique SessionIDs from the lock table and use _GetSessionLoggedIn to check if they logged in (no locks unless logged on this system), it works fine.

The thing that concerns me about doing this in the webserver procedure is the time it could take and the fact it could potentially disrupt the webservers functionality. So I call a procedure on a new thread and reference the webserver class and the _GetSessionLoggedIn  method in there, but now I'm becoming concerned that calling a method in the referenced class from a different thread may also clash with the same class instance running in the webserver procedure, is it a bad idea?

Any advice would be appreciated.

Gordon

19
When I place a Text field on a form it works as expected, scrollable and return creates new lines. However, if I change the field to read only I appear to get a read only string field with no box, no scrolling and line feeds are removed, basically just a continuous line of text. What am I doing incorrectly?

I'm using NT 12.17.

Any help would be appreciated, I'm sure it is just my lack of NT knowledge that is causing me difficulty.

Best Regards
Gordon

20
Web Server - Ask For Help / LetsEncrypt Certificate Renewal
« on: June 15, 2021, 03:59:48 AM »
My first few sites to use my webserver application went live mid May and I have a question about LetsEncrypt.

Am I correct in thinking a webserver app will auto renew the LetsEncrypt certificate so long as port 80 and port 443 are open or do I need to include code to renew periodically?

Also if it is automatic how frequently or how long before it expires does it get renewed?

Does it make any difference if the webserver is running as a service?

Any clarification will be appreciated.

Gordon

21
I've searched and can't find an answer to my question, so I'm hoping someone can help.

I have a memory rather than file based form and I use it in 2 modes and display information in one mode and and allow interaction with save or cancel in the other mode, I use 2 tabs to do this. What I would like to be able to do is hide the save button on a condition, I realise I can disable the save button conditionally but this also disables the cancel button and I need the cancel to remain active. I guess I could achieve this by using 2 forms but that seems like a less than ideal method.

Any help would be greatly appreciated.

Gordon

22
Web Server - Ask For Help / HTML data entry masks
« on: May 21, 2021, 04:11:45 AM »
Has anyone used html data entry masks, I'm particularly thinking about dates and times so the separators such as / and : are fixed in the input and the entry moves from dd to mm to yyyy as the elements are filled, no need to type a separator. I understand how this can be done in html code but I'm uncertain where to place the mask details in a webserver form field definition.

Gordon


23
I realise this is probably a theme css change but I thought I'd ask.

On a NetTalk 12 app using flexbox on forms, entry field prompts understandably move from being on the left of the entry to above the related entry when screen width is limited (eg on a phone). However and this is just my own preference I would really like the prompts to be left aligned with the related entries rather than centred where they can sometimes look detached and unrelated.

It there a simple global change I can make so the whole app behaves this way or do I have to override the css for prompts on every form. I use the base theme so perhaps the correct answer is
 to modify the css, obviously I'll then have to maintain my own theme from this point on.

I'm new to WebServer so my question may seem naive, don't worry I'm a quick learner so I won't be constantly asking questions, once again any advice and guidance is welcome.

Cheers
Gordon

24
I'd be very interested to know what strategies people employ to manage potentially concurrent record updates. Being session based and given the vagaries of internet connections, I wouldn't use any actual record locking, in fact I don't use standard record locking in my multiuser desktop applications, I use a record hold control file to the same effect.

I realise that some multiuser application really don't need records to be held as they tend to partition off users to their own areas, however more general purpose systems run a real risk of data loss if record updates aren't protected in some form.

While I'm happy with my reliable approach for desktop apps, I'm also looking at optimistic locking, which is actually no locking until it is time to commit changes. The problem is that it is late in the day to discover someone got there first and your updates will overwrite their update or yours will be lost, merging changes is only a likely partial and potentially confusing alternative to the first two choices.

Therefore I think the approach I will take is extend my current locking strategy to use the sessionid (am I correct in believing this remains constant for the duration of a user's session?), that way the web users and desktop users can operate on the same data in harmony. In effect I will hold a record via my hold table if it is not already held. If it is indicated as held by a sessionid I will check the session is still active, if not I will purge that session's locks and lock the record for the new requester. When a record is updated or the update process is cancelled I will release the lock. I will also release all locks for a session at session timeout or user logout. The webserver would also purge all locks at start-up and I could also have a housekeeping background thread checking for litter, as in locks from no longer active sessions but this shouldn't be required if I get the rest right.

Before someone says don't lock/hold a record (real or via my method) I should say my clients deal with medical records and arbitrarily writing over changes to data is simply not an option.

Please feel free to comment, I'm not afraid of help or criticism.

I seem to have posted a few messages in the last few days, my excuse is I'm new to WebServer and this forum so please tolerate my posts, hopefully they aren't banal.

Gordon

25
I have a question relating to the client software upgrade process.

During client system upgrades there is a requirement to close any running applications, perform the upgrade and then relaunch any applications that were stopped.

For years I have used an ini file to control requests to suspend and then restart, basically I have a suspend, a start and a control app for each background application in the suite, by using these I get reliable and graceful control over upgrades. However, it is something I have used for many years and I'm sure that there may be a better method of achieving inter-application communications, maybe using built-in Windows events, so feel free to enlighten me, perhaps WinEvent already provides this facility.

Now to the point, I have only recently added a WebServer application to the suite and it is working fine, but I do have one concern and perhaps Bruce is best placed to answer this question. By default I have a 1 second timer on the application's main Window (WebServer), each second I check an ini for a suspend request, if found the application closes gracefully. My concern is the effect a 1 second timer will have when running on the main WebServer window. The alternative is to launch a timer process on a separate thread and pass a user defined event or a notify back to the webserver window to instruct it to close down.

Any suggestions welcome, how do others close a webserver for software upgrades, there are too many clients to do this manually.

Gordon

26
Web Server - Ask For Help / PDF viewing on IOS
« on: May 18, 2021, 04:38:10 AM »
Normally embedded PDF's don't scroll on an IOS device, has anyone tried a solution such as PDF.js to get around this, if so how successful was it?

Cheers
Gordon

27
Web Server - Ask For Help / NetTalk 12 and Date entry
« on: May 17, 2021, 08:16:25 AM »
Since upgrading to NetTalk 12 and using the 'base' theme the horizontal alignment of a date field, lookup button and comment on a form are no longer horizontally in line, the lookup and comment are lower than the prompt and entry. Has anyone experienced this and if so is there a fix.

Also is it possible to have a date field without the calendar lookup button?

Any help will be much appreciated.


28
Web Server - Ask For Help / Webserver iconized
« on: May 17, 2021, 02:36:56 AM »
Hi,

I'm new to NetTalk Central and also quite new to Webserver, so forgive me if the answer to my question seems obvious, as it isn't obvious to me.

Will a webserver app run perfectly normally minimized (iconized), I know I can run it as a service but for the time being I'd like to run it iconized, might seem like a silly question but I'm not sure if running iconized would affect the resources and priory for the app.

Any advice appreciated.
Gordon

Pages: 1 [2]