This forum allows developers to post programming tips and coding techniques that may be useful to other Visual LANSA developers. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Begin_Com Role(*EXTENDS #VF_AC026O)
Define_Com Class(#PRIM_TIMR) Name(#LogonShortDelayTimer) Interval(1) Startup(Manual)
* ------------------------------------------------------------
Evtroutine Handling(#LogonShortDelayTimer.Tick)
#LogonShortDelayTimer.Stop
* Replace TheUser and ThePassword with valid credentials.
Signal Event(LogOnAttemptRequested) Platformu(TheUser) Platformp(ThePassword)
Endroutine
* ------------------------------------------------------------
* Handle getting required user profile and password
Mthroutine Name(uRequestPlatformUCredentials) Options(*REDEFINE)
Define_Com Class(#Prim_Boln) Name(#AtEntry_FrameworkLoadListAttempted)
* Track what the framework list load attempt flag says at entry
#AtEntry_FrameworkLoadListAttempted := #FrameworkListLoadAttempted
* Do ancestor processing
#Com_Ancestor.uRequestPlatformUCredentials Templogonmanager(#TempLogonManager) Attemptedrequests(#AttemptedRequests)
* No log on form is to be visible
#Com_Owner.Visible := False
* If the frameworks list still needs to be loaded return control and wait for
* that to happen. When it does happen this method will be called again.
If (#AtEntry_FrameworkLoadListAttempted = False)
Return
Endif
* There is only one automatc attempt allowed otherwise bad values will get stuck in a loop
If (#AttemptedRequests > 1)
#uSystem.IssueTextMessage Text('The server has rejected your logon request. Check the user and password used.') Collectionnumber(1)
#uSystem.SignalRequestExit Possibletocancel(False) Browserisclosing(False)
Return
Endif
* If we reach here then start the log on a slight delay
#LogonShortDelayTimer.Start
Endroutine
End_Com
Begin_Com Role(*EXTENDS #VF_AC026O)
Define_Com Class(#PRIM_TIMR) Name(#LogonShortDelayTimer) Interval(1) Startup(Manual)
* ------------------------------------------------------------
Evtroutine Handling(#LogonShortDelayTimer.Tick)
#LogonShortDelayTimer.Stop
* Replace TheUser and ThePassword with valid credentials.
Signal Event(LogOnAttemptRequested) Platformu(THEUSER) Platformp(THEPASSWORD)
Endroutine
* ------------------------------------------------------------
* Handle getting required user profile and password
Mthroutine Name(zInt_RequestPlatformUCredentials) Options(*REDEFINE)
Define_Com Class(#Prim_Boln) Name(#AtEntry_FrameworkLoadListAttempted)
* Track what the framework list load attempt flag says at entry
#AtEntry_FrameworkLoadListAttempted := #FrameworkListLoadAttempted
* Do ancestor processing
#Com_Ancestor.zInt_RequestPlatformUCredentials Attemptedrequests(#AttemptedRequests)
* No log on form is to be visible
#Com_Owner.Visible := False
* If the frameworks list still needs to be loaded return control and wait for
* that to happen. When it does happen this method will be called again.
If (#AtEntry_FrameworkLoadListAttempted = False)
Return
Endif
* There is only one automatc attempt allowed otherwise bad values will get stuck in a loop
If (#AttemptedRequests > 1)
#uSystem.zInt_IssueTextMessage Text('The server has rejected your logon request. Check the user and password used.') Collectionnumber(1)
#uSystem.zInt_SignalRequestExit Possibletocancel(False) Browserisclosing(False) Timeoutinprogress(False) Fatalerror(True)
Return
Endif
* If we reach here then start the log on a slight delay
#LogonShortDelayTimer.Start
Endroutine
End_Com
I was trying to incorporate the code that you provided and I get a javascript error as soon as I click on anything after my app loads. Just clicking on anywhere causes the error. If I change the login handler back to the VF_AC026O in my launch page it all works again. Here is the error. I was wondering if you had any thought as to why this might be happening.
Attachments
2019_08_02_12_42_11_SD_One_Framework.png (23.19 KiB) Viewed 328086 times
Failing that, add these lines to the logon avoidance reusable part:
Evtroutine Handling(#COM_OWNER.CreateInstance)
Set Com(#Com_Owner #InputPlatformU_MD #INPUTPLATFORMU #InputPlatformP_MD #INPUTPLATFORMP) Visible(False)
Endroutine
Recompile it, clear your browser cache, and try again.
BTW - Did you ever install any beta or pre-release versions of VL-Web or of VLF?
If yes, did you replace them with the final GA versions, including partition the required VLF initialization?
I tried both your suggestions and neither seemed to work. And as far as I know, I have never installed a beta release. I'm sure it's something that I'm doing wrong. I'm trying to recreate the process you outlined in post viewtopic.php?f=3&t=2109&p=5646. I created a lansa web page using #PRIM_WEB that I placed before our original launch page because we needed additional information at login time. Basically what my login page does is validate the user id and password and then it retrieves any environments the user may be authorized to since we have customers that have multiple environments set up. once we get the environment, we can then override to the correct axes project and set the library list in our server modules. The login page does a Web.Navigate to our original launch page with the extra query string parm GUID and tries to bypass the launch page login screen and go straight to the login validater. All that seems to work like you outlined, but then I get my java script error as soon as I click anything.
Here is my login page that I created. It's ugly at the moment but I was just trying to get it working.
Have you tried the preceding example without your extra login form in front of it (i.e. As a straight through no dialog logon)?
You might have to temporarily alter the server side validation to let you in.
Have you tried the preceding example without your extra login form in front of it (i.e. As a straight through no dialog logon)?
You might have to temporarily alter the server side validation to let you in.
Hey Mark, I just tried your suggestion. I modified my login validater to set the output parms and just return OK. Went straight to the original launch page and I still get the javascript error.
Begin_Com Role(*EXTENDS #VF_AC026O)
Define_Com Class(#PRIM_TIMR) Name(#LogonShortDelayTimer) Interval(1) Startup(Manual)
* ------------------------------------------------------------
Evtroutine Handling(#LogonShortDelayTimer.Tick)
#LogonShortDelayTimer.Stop
* Replace TheUser and ThePassword with valid credentials.
Signal Event(LogOnAttemptRequested) Platformu(THEUSER) Platformp(THEPASSWORD)
Endroutine
* ------------------------------------------------------------
* Handle getting required user profile and password
Mthroutine Name(zInt_RequestPlatformUCredentials) Options(*REDEFINE)
Define_Com Class(#Prim_Boln) Name(#AtEntry_FrameworkLoadListAttempted)
* Track what the framework list load attempt flag says at entry
#AtEntry_FrameworkLoadListAttempted := #FrameworkListLoadAttempted
* Do ancestor processing
#Com_Ancestor.zInt_RequestPlatformUCredentials Attemptedrequests(#AttemptedRequests)
* No log on form is to be visible
#Com_Owner.Visible := False
* If the frameworks list still needs to be loaded return control and wait for
* that to happen. When it does happen this method will be called again.
If (#AtEntry_FrameworkLoadListAttempted = False)
Return
Endif
* There is only one automatc attempt allowed otherwise bad values will get stuck in a loop
If (#AttemptedRequests > 1)
#uSystem.zInt_IssueTextMessage Text('The server has rejected your logon request. Check the user and password used.') Collectionnumber(1)
#uSystem.zInt_SignalRequestExit Possibletocancel(False) Browserisclosing(False) Timeoutinprogress(False) Fatalerror(True)
Return
Endif
* If we reach here then start the log on a slight delay
#LogonShortDelayTimer.Start
Endroutine
End_Com
and changing the server validation routine to unconditionally let you in, two different people here have run this and cannot reproduce your error.
You can start the application directly via UF_OEXEC or DF_OEXEC and sign on without seeing the dialogue, and you can execute things once started.
If this is exactly what you did to start out - then I think the only recourse now is to report the issue to support with all version details, etc.
If this is not exactly what you did to start out - could you see if this simplest possible case works for you.
what I'm doing is exactly like what you are describing. Our launch page is just like UF_OEXEC and my handler is exactly like the code that you posted. The problem seems to be the browser. We've been experiencing different behavior with javascript within aXes between browsers so I just tried using FireFox instead of Google Chrome and it worked perfectly. I also tried it with Microsoft Edge and that worked as Well.
The version of Google Chrome that I'm using is version 76.0.3809.100 (Official Build) (64-bit).
hey Mark, I discovered something with this issue that you may be able to point me in the right direction. When I log in to my custom login form and navigate to our original launch page that now has the login handler if I don't touch(click) anything in the browser window I get the javascript error. But if I log in and as the loading wheel is spinning I click anywhere in the browser then all is fine and I do not get the javascript error and everything seems to run just fine. I was wondering if you may have any ideas on what I could try? It's like something needs focus or something.
One final thought. I tried my app from my home pc using chrome which has the same version and everything worked fine. I can only assume it has something to do with chrome on my work pc. I'm going to try and uninstall and reinstall tomorrow to see if that fixes my issue.