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

© 1996-2019