FoxInCloud
View parameters & wViewParmSet()
Gravatar is a globally recognized avatar based on your email address. View parameters & wViewParmSet()
  Paul
  All
  Jan 23, 2019 @ 08:16pm

Hi,

In the Init of a form I have this :

thisform.wViewParmSet("MfgArea_BinStructure_Location", "TheLocationID", DefaultsObject.ShopFloorUISettingsObject.LocationID)
...and then open the remote view MfgArea_BinStructure_Location with the parameter TheLocationID

DefaultsObject.ShopFloorUISettingsObject.LocationID is a global object that contains different property values per user, so the code above is in the Init outside of the wlInitFirst section, as it needs to execute when each user opens the form.
This is fine during initialisation and the contents of the cursor conform to the parameter that was passed.

The problem I have is that later, in the Valid event of a textbox, I find that the contents of the cursor have changed - as though TheLocationID is now "".
So it appears as though wViewParmSet is not being obeyed.
While in the Valid event I see that DefaultsObject.ShopFloorUISettingsObject.LocationID is correct, but could it be that the view is being requeried before the global object properties are restored?

Or any other thing I am missing?

Thanks
Paul

Gravatar is a globally recognized avatar based on your email address. re: View parameters & wViewParmSet()
  Gilles Lajot-Sarthou
  Paul
  Jan 24, 2019 @ 01:07am

Hi Paul

For executing the requery of a view with FoxInCloud you must indicate to .T. the forth parameter in wViewParmSet("MfgArea_BinStructure_Location", "TheLocationID", DefaultsObject.ShopFloorUISettingsObject.LocationID, .T.) If you do not indicate .T., you only say to FoxIncloud to prepare the view without requery().

Regards Gilles

Gravatar is a globally recognized avatar based on your email address. re: View parameters & wViewParmSet()
  FoxInCloud Support - Thierry N.
  Paul
  Jan 24, 2019 @ 03:17am

Hi Paul,

could it be that the view is being requeried before the global object properties are restored?

no, as you can see here, restoring app. state for user occurs before restoring form state for user

it appears as though wViewParmSet is not being obeyed.

As Gilles mentioned, to instruct FoxInCloud to requery, you need to pass .T. as 4th parameter to .wViewParmSet() ; this is designed for views with multiple parameters; you want to requery() only after the last parameter is set.

Gravatar is a globally recognized avatar based on your email address. re: View parameters & wViewParmSet()
  Paul
  FoxInCloud Support - Thierry N.
  Jan 24, 2019 @ 03:17pm

Hi,

I understand about the fourth parameter, but I am choosing not to use wViewParmSet() to actually open the view and instead continue to use my own function that does this as is it contains a lot of logic around caching (norequery, again), nodata etc.
I am assuming, possibly incorrectly, that simply calling wViewParmSet to store the view parameters in FiC before I call my own function is enough and that FiC would later see those stored parameters and use them when requerying the views itself.

Is this valid? Or must I call wViewParmSet to actually perform the "use" command to open the view (I see you are using a CursorAdapter, but you see what I'm saying).
If I must call wViewParmSet to actually fetch the data then that is a big problem for me, as I rely on "use norequery" and "use again" to perform different types of caching and I don't think a cursoradapter has the same ability (I could be wrong...).

Paul

Gravatar is a globally recognized avatar based on your email address. re: View parameters & wViewParmSet()
  FoxInCloud Support - Thierry N.
  Paul
  Jan 25, 2019 @ 01:12am

Hi Paul,

Not sure I understand what you intend to do.

.wViewParmSet() is NOT intended to USE the view, only to set parameters and requery(). Compared to a plain requery(), using .wViewParmSet() to requery the views brings several additional benefits such as:

As demoed in modify form home(1) + 'Tools/AB/AW/Samples/FIC/FicTuto/progs/forms/dataUpdate.scx', you should:

  1. USE your views in the dataEnvironment or .Load() method using whatever clauses you need (adding NODATA is recommended to start the form and generate HTML without 'random' data that the user would see before getting his/her own data),
  2. in form.Init() and user events, (re)fill the view using .wViewParmSet() (Please note that FoxInCloud supports progressive fetching)

I confirm that calling .wViewParmSet() stores the parameter's name and value into the user's form state table for later state save and restore.

© 1996-2019