Hi,
After login I open a modeless form with wform() :
FormReference = wForm("Workflow")
A few days ago the form was appearing in the browser, but now it briefly appears in the browser and then disappears!
I'm not hiding the form.
What have I done wrong?
Also, I tried using wformmaster() instead of wform(), but nothing happened.
I see there is also awserver.wFormStandardPage - can this, or some equivalent, be called outside of the sficserver object?
Where can I read more about the different ways of opening a form?
p.s. I noticed that the Load() of the form was called 3 times (!!). Is this normal?
Should it have a if m.this.wlInitFirst or !m.this.wlWeb
section like the Init()? (if so, the form's parent class which has code in the Load() has not had this added during the adaptation process).
Thanks
Paul

FormReference = wForm("Workflow")
- why do you use
wForm()
instead ofthisForm.wForm()
? "Workflow"
is a form class, right? otherwise you need"Workflow.scx"
- can you post a video showing the behavior? if possible showing the developer tools pane.
here is the document: http://foxincloud.com/pdf/FoxInCloud-How-to-wForm-en.pdf
- the form is opened from a procedure called from the login form, not from the form itself. I'm trying not to change existing code unless I have to.
- yes, a class
- hmm, not much to see really. The form appears for a second and vanishes.
I have found this :
- if I open a form with wform(), from the login form (indirectly), it vanishes
- if I open the same form from a menu or the FiC index page (with all of the form links) then the form remains visible; still using wform()
What am I doing wrong with using wform() vs some other function?
Paul
I suspect the index page reloads
Please check in Browser Developer Tool's network
panel;
make sure to check 'keep history'; see screenshot below

I found the problem - after the next form was executed with wform(), the login form was "closed" with thisform.release; since the login form is not a "subform", the home page is displayed via m.loAJAX.BackHome instead.
What should I do instead of thisform.release if I want the login form to disappear (.hide doesn't seem to work)?
I now see that wFormMaster() does not work with classes, only .scx forms - is this by design or an oversight?
I could restructure the code to put the call to the next form inside the login form itself so I can use thisform.wFormMaster(), but is there an alternative (something like AJAXMenuSelect from a menu)?
Paul
If login is a master form and you want to close it once user is identified, the next form should also be a master form. Here is a working code sample:
IF m.lOkLogin AND m.lOkMp
=THISFORM.wUserLogIn(m.THISFORM.codeope) && IMPORTANT - tells FoxInCloud user is identified
* menu
WITH _SCREEN
._code_ope = m.THISFORM.codeope
=lire_mesdroits()
._MENU = IIF((EMPTY(._profil) OR INLIST(._profil, "TIERS", "PATIENT") OR (._profil = "PRESCRIPTEUR" AND droitacces(1,.T.) < 1)) = .T.;
, IIF(wlLAN(),'BVLVISU','BVWVISU'); && menu de consultation simple
, IIF(wlLAN(),'BVL','BVW'); && menu de complet
)
* Forcer l'affichage du menu
._ActiveMenu = .F.
ENDWITH
=lire_session() && user rights
=sysMenuUpdate() && menu update
IF m.THISFORM.IdDossier > 0
* Appel du formulaire de Consultation
EXTERNAL FORM consultation
consultation = thisForm.wFormMaster('consultation.scx', m.THISFORM.IdDossier)
ENDIF
=THISFORM.RELEASE()
ELSE
…
wFormMaster() does not work with classes
[.]wFormMaster()
does work with classes, provided that xxxSets.Init()
SETs the class library and form can instantiate and initialize fine.
You should find additional details in wwRequestLog.dbf
and/or in xxxTest.lwr
Otherwise please post a video with network panel open as explained earlier in this thread.
Hi,
The wFormMaster function (in awPublic.prg, not the wFormMaster method in awfrm) contains this code :
llResult = Vartype(m.tcForm) == 'C' and File(m.tcForm) and Lower(JustExt(m.tcForm)) == 'scx'
so I have stopped using it, as almost all of my forms are classes. This means that to use form.wMasterForm, existing procedure code that opens a master form will need to understand about the form that called it - not a big deal I suppose as opening a master form only happens a few times. .
I call the login form via sficServer.Index :
Return this.wFormStandardPage("LoginForm", ...)
- does this make it a master page?
Once the user is validated, I call the next form via thisform.wFormMaster() and afterwards release the form :
If thisform.LoginSuccess
...
thisForm.wUserLogIn(EnteredUserID)
..
thisform.wFormMaster("ShopFloorMenu", ...) && ShopFloorMenu is a class
thisform.Release
Endif
When I debug awfrm.release I see that m.this.wlSubForm = .F. :
IF m.this.wlSubForm
m.loAJAX.cScriptJSadd_(m.this.wcFormCloseScript(,,,.T.)) && .T.: pas d'événement dans ce cas
ELSE
m.loAJAX.BackHome && {en} back to home page {fr} retour à la page d'accueil
ENDIF
and the BackHome method is executed.
I did prepare some screenshots of the network panel, but it seems that my problem lies with how I am opening the login form, so I'm not sure if they will help.
Thanks
Paul
Paul,
You're right on both points:
- the
wFormMaster()
function supportsform.scx
only; could and should support classes also;
can you pass the form reference as an additional parameter to your function?
function yourFunc
lparameters parm1, parm2, …, parmN, toForm
…
toForm.wFormMaster('class')
…
.BackHome()
overrides.wFormMaster()
; here is a workaround:
thisForm.wFormMaster()
…
if thisForm.wlLAN
thisForm.release
endif
Thanks Thierry,
One remaining question around this :
If I wanted to emulate a multi document interface, i.e. the login form will show a "subform" via thisform.wform(), rather than show a master form, what code can I use to hide the login form (which is now present "behind" the subform)?
- or is the idea to always have a master form? (ok, two questions 😉 )
Paul
You need at least the home page as master form.
It can be very simple: logo, about, menu and/or button for identification & de-connection.
After connection, you can expand the menu based on user's right, and/or show or enable more action buttons. After user is identified, it may look like this.
Be aware that:
- the responsive rendering mode (Bootstrap like in http://foxincloud.com/tutotest/bs/) does not support MDI as Bootstrap modals can't be moved;
- in classic rendering mode, FoxInCloud supports form resizing using
.Anchor
, and automatically saves and restores the forms' dimensions and position across user requests and sessions (based on a given couple browser-machine) -- see https://www.youtube.com/watch?v=TyDRFm2nKPs;
Paul,
In V 2.28.1-beta.1
soon released, wFormMaster()
supports form classes;
You can see that live here: http://foxincloud.com/tutotest/bs/ > menu pad More
> popup bar Error Browser
The menu pad code calls this snippet:
* *********************************************************
* *
* * _5EK1328DQ ON SELECTION BAR 10 OF POPUP enmorefrpl
* *
* * Procedure Origin:
* *
* * From Menu: TUTO.MPR, Record: 27
* * Called By: ON SELECTION BAR 10 OF POPUP enmorefrpl
* * Prompt: {en} Error Browser {fr} Analyseur d'erreurs
* * Snippet: 20
* *
* *********************************************************
*
PROCEDURE _5ek1328dq
return wFormMaster('ficFrmLogError') && ficFrmLogError as awFrmLogError of aw
*return tutoNavigate("ErrorLog.tuto") && modify command tutoSets
In desktop mode, as a master form is supposed to stay around and be a host for child forms, we've used .show(1)
regardless of .WindowType
.
Please let me know if it makes sense.