January 16, 2020 at 10:51 am #24139
I have been struggling with something for a while now.
I am creating a website with OS10.1 and I have a classic jsHome page and some other pages linked by a jsMenuNavMenu, being launched by the Startup_Task. On the homepage I can refresh the page using the web bowser, but once I changed the page, if I refresh it, Omnis studio crashes. I clearly have done something wrong but can’t figure out what. Once in a while, it does reload without problem.
Thanks and regards,
Coralie.January 16, 2020 at 10:57 am #24140
The first thing I would ask is what browser you are using.
Secondly, you say ‘once I changed the page’…do you mean that you have performed a $changeform?
GavJanuary 16, 2020 at 11:11 am #24141
As for the browser, the same thing happens regardless of which one I am using.
The methods used for the navigation basically come from the “jsnavmenu sample” of Omnis’s hub, so I have an object oNavMenu, with an iNavObj that $construct, $buildmenu, $getMenu, defineMenuList, and $getJsFormName throughout the site.
Coralie.January 16, 2020 at 11:57 am #24142Andreas PfeifferParticipant
I am a little bit confused when you write that the form is launched by the Startup_Task. One can actually do this but normally a remote form is instantiated by either using the html file that points to it or using i.e. $ctask.$changeform or $openform. That said they are using a remote task (not the Startup_Task) as a container for its own instance.
However you could try to find out why the crash happens using the command
Do sys(3000) somewhere in the code. This brings up a message that the code is then traced in a log file. When Omnis crashes you can have a look in that log file and possibly see what command caused the problem.January 16, 2020 at 12:40 pm #24143
I haven’t studied the Navigation Menu Object before but just took a look at the sample library.
The sample library does not crash when I use it, so I assume it’s something that happens in the On evMenuEntryClicked event.
The sample library has:
Do $cinst.$showmessage(con('Ident ',pLineIdent),'Click')
Have you changed this code and if so, to what?
GavJanuary 16, 2020 at 2:09 pm #24144
I am using the Startup_Task just so I can have the page launched when opening the library on development. I only have Do $clib.$remoteforms.jsMenuNavMenu.$open() written in it.
However, with the use of sys(3000), I got this log below just after my last method (it is quite long sorry) :
SQL.Startup_Task/$resume Calculate tSystemCall as tInSystemCall ## ensure tSystemCall is still correctly set, as omnis events elsewhere could have triggered a $suspend
0: SQL.Startup_Task/$i_nv_logged_off # called by the core when a session using a new non-visual dam is closed outside the sql object browser
0: SQL.Startup_Task/$i_nv_logged_off Do method $i_deleted_session_or_cursor (pSessName)
0: SQL.Startup_Task/$i_deleted_session_or_cursor # called by the core when either a session or cursor is closed outside the sql object browser
0: SQL.Startup_Task/$i_deleted_session_or_cursor Calculate tSystemCall as kTrue ## do not revert the current session to OMNIS_DEFAULT when $suspend is executed
0: SQL.Startup_Task/$i_deleted_session_or_cursor Calculate tInSystemCall as kTrue ## currently processing call from outside of the sql browser
0: SQL.Startup_Task/$i_deleted_session_or_cursor If mid(pCursorName,1,6)<>’OMNIS_’&mid(pCursorName,1,6)<>’BLYTH_’
0: SQL.Startup_Task/$i_deleted_session_or_cursor # session is not an internal session
0: SQL.Startup_Task/$i_deleted_session_or_cursor Do gSessionList.$search(gSessionName=pCursorName,kTrue,kFalse,kTrue,kTrue)
0: SQL.Startup_Task/$i_deleted_session_or_cursor Set reference lSearchRef to gSessionList.$first(kTrue,kFalse)
0: SQL.Startup_Task/$i_deleted_session_or_cursor If lSearchRef
0: SQL.Startup_Task/$i_deleted_session_or_cursor Do method close_session_windows
0: SQL.Startup_Task/close_session_windows # called by the methods ‘$i_deleted_session_or_cursor’ and ‘$i_logged_on’ to close all the windows associated with the session ‘pCursorName’
0: SQL.Startup_Task/close_session_windows Do gSessionList.$loadcols() ## current line already set in calling method
0: SQL.Startup_Task/close_session_windows # Do code method STARTUP/get_session_details (gv_ToolsLib_name,gSessionDBVer,lSessUser,lSessHasSubs,lSessHasUsers,lObjTypesList,gSessionConnect)
0: SQL.Startup_Task/close_session_windows # Do lObjTypesList.$redefine(lObjType)
0: SQL.Startup_Task/close_session_windows #
0: SQL.Startup_Task/close_session_windows # For lLineInList from lObjTypesList.$linecount to 1 step -1
0: SQL.Startup_Task/close_session_windows # Do lObjTypesList.$line.$assign(lLineInList)
0: SQL.Startup_Task/close_session_windows # Do lObjTypesList.$loadcols()
0: SQL.Startup_Task/close_session_windows # Calculate lWinInstName as con(gSessionName,’_’,lObjType)
0: SQL.Startup_Task/close_session_windows # Close window instance [lWinInstName] ;; close object browser windows (3rd Level)
0: SQL.Startup_Task/close_session_windows # End For
0: SQL.Startup_Task/close_session_windows Do $iwindows.$sendall($ref.$close(),pos(con(gSessionName,’_’),$ref().$name)&$ref.$lib().$name=’SQL’) Returns #F ## 14/03/02 – replaces the above code
0: SQL.Startup_Task/close_session_windows Calculate lWinInstName as gSessionName
0: SQL.Startup_Task/close_session_windows Close window instance [lWinInstName] ## close object types browser window (2nd Level)
Since it does mention a Startup_Task, the problem could be the fact that I am launching the page through the task ? Or is this log normal and I should be looking elsewhere in the log?
Regarding the sample Gav, I have also tried with Applets and Samples and it’s working fine. That’s why I said that it’s clearly me who has done something I really shouldn’t have. My guess is that it is related to the login/logoff because on my homePage, before I logged myself onto my account, I can refresh the page as many time as I want to.
Thank you very much for helping me,
CoralieJanuary 17, 2020 at 11:10 am #24145
None of the methods in the log are in the JsNavMenu library so I don’t know where they have come from.
I guess you need to track down what is calling SQL.Startup_Task/$resume
Also, is $close_Session_windows designed to close ‘window’ classes or ‘remote form’ classes?
As you say Studio is ‘crashing’, it may be trying to reference something (close a window instance) that does not exist, so you would want to put a ‘Breakpoint’ command in there before the ‘Close window instance’ command and see what it is doing.
GavJanuary 17, 2020 at 11:40 am #24146
None of the methods from the log come from my library. I have no idea either where they come from but after multiples attempts, those lines never showed up again so I don’t think it is related.
After a closer look, I noticed that I did not used the jsNavMenu sample but more the “myapplication.lbs” used during the Omnis formation. So I have tried to refresh a page with this library, it also does work properly.
We spent a few hours with Alain Teboul trying to figure out the issue, using the log of my library and the one of “myapplication” and it has led us to the track of the rtTask. In “myapplication.lbs”, the rtTask constructs itself, then when the page gets refreshed, it destructs itself and then reconstructs :
myapplication.jscountriesForm/$event End If
0: myapplication.jsMenuNavMenu/$destruct # Enter your termination code here
0: myapplication.jsMenuNavMenu/$destruct Calculate ltest as ‘ok’
0: myapplication.rtMyTask/$destruct # Enter your termination code here
0: myapplication.rtMyTask/$construct # Enter your initialization code here
0: myapplication.jsMenuNavMenu/$construct # Enter your initialization code here
0: myapplication.jsMenuNavMenu/$construct Calculate iRow as pRow
However, for some reason that we have not yet resolved, my library seems to be unable to reach it once constructed. It constructs itself at the beginning and then it disappears from the log:
non.Startup_Task/$construct Calculate lTest as sys(3000)
0: non.Startup_Task/$construct # Do $clib.$remoteforms.jsMenuNavMenu.$open()
0: non.rtTask/$construct Breakpoint
0: non.rtTask/$construct Calculate lTest as ‘ok’
0: non.jsMenuNavMenu/$construct Breakpoint
0: non.jsMenuNavMenu/$construct Do $cinst.$objs.SubWindow.$classname.$assign(‘jsHome’)
So I must have done something, at some point that cause the rtTask to become unreachable. Both of the rtTask (mine and the working library) are exactly the same.
You must be logged in to reply to this topic.