FoxInCloud
wform() and wformmaster()
Gravatar is a globally recognized avatar based on your email address. wform() and wformmaster()
  Paul
  All
  Jan 8, 2019 @ 04:43pm

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

Gravatar is a globally recognized avatar based on your email address. re: wform() and wformmaster()
  FoxInCloud Support - Thierry N.
  Paul
  Jan 8, 2019 @ 11:51pm

FormReference = wForm("Workflow")

  1. why do you use wForm() instead of thisForm.wForm()?
  2. "Workflow" is a form class, right? otherwise you need "Workflow.scx"
  3. 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

Gravatar is a globally recognized avatar based on your email address. re: wform() and wformmaster()
  Paul
  FoxInCloud Support - Thierry N.
  Jan 10, 2019 @ 10:17pm
  1. 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.
  2. yes, a class
  3. hmm, not much to see really. The form appears for a second and vanishes.

I have found this :

  1. if I open a form with wform(), from the login form (indirectly), it vanishes
  2. 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

Gravatar is a globally recognized avatar based on your email address. re: wform() and wformmaster()
  FoxInCloud Support - Thierry N.
  Paul
  Jan 11, 2019 @ 12:30am

I suspect the index page reloads

Please check in Browser Developer Tool's network panel;
make sure to check 'keep history'; see screenshot below

Gravatar is a globally recognized avatar based on your email address. re: wform() and wformmaster()
  Paul
  FoxInCloud Support - Thierry N.
  Jan 15, 2019 @ 01:57pm

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

Gravatar is a globally recognized avatar based on your email address. re: wform() and wformmaster()
  FoxInCloud Support - Thierry N.
  Paul
  Jan 16, 2019 @ 12:13am

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.

Gravatar is a globally recognized avatar based on your email address. re: wform() and wformmaster()
  Paul
  FoxInCloud Support - Thierry N.
  Jan 16, 2019 @ 02:07am

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

Gravatar is a globally recognized avatar based on your email address. re: wform() and wformmaster()
  FoxInCloud Support - Thierry N.
  Paul
  Jan 16, 2019 @ 01:20pm

Paul,

You're right on both points:

  1. the wFormMaster() function supports form.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')
…
  1. .BackHome() overrides .wFormMaster(); here is a workaround:
thisForm.wFormMaster()
…
if thisForm.wlLAN
  thisForm.release
endif
Gravatar is a globally recognized avatar based on your email address. re: wform() and wformmaster()
  Paul
  FoxInCloud Support - Thierry N.
  Jan 16, 2019 @ 03:30pm

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

Gravatar is a globally recognized avatar based on your email address. re: wform() and wformmaster()
  FoxInCloud Support - Thierry N.
  Paul
  Jan 17, 2019 @ 12:06am

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;
Gravatar is a globally recognized avatar based on your email address. re: wform() and wformmaster()
  FoxInCloud Support - Thierry N.
  Paul
  Jan 31, 2019 @ 09:30am

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.

© 1996-2019