is it an alias ?
the best doing, is to open the cursor in the load() method of the form and after put the recorsource of the grid in the code of the init() method of the form..
+
Gilles
Still not working. We removed both grids from the child form and still the new chilod form is not being launched. The main form is closed or hidden and we are looking at a blank screen. We will now try reverting back to the original sample app which successfully launched a very simple child form last week.
In FAA the wAfterRowColChange() does not exist.. only wAfterRowChange() or wBeforeRowChange() OR wAfterColChange() OR wBeforeColChange() will be used..
when you use FAA, you never use AfterRowColChange() in a grid. You only have to use wAfterRowChange() OR perhaps wAfterColChange()..
+
Gilles
We made the suggested changes. Since we need the app to run in VFP IDE, we would like to retained the .AfterRowColChange event code as well as the .wAfterRowColChange code. .wAfterRowColChange is not doing anything for VFP IDE - right/wrong??
Form2 (form containing the parent and child grids) launches in VFP IDE but in browser screen remains blank after the default "loading" icon appears for a brief time.
Form2 launched fine in our initial testing when Form2 was a more simple form with just text.
Form2 is called from a command button click event:
external form FORM2
FORM2 = m.thisform.wForm('FORM2.scx',.f.)
There are no errors to report in VFP IDE or in the browser.
Any suggestions?
Garth
I'am Frenchy and my english is poor..
Garth you dont have to know what is tuRow.. you only have to respect the FAA syntaxe, like in your forward code..
tuRow is use by FAA to seek the current recno in the grid before and after a HTML query..
LPARAMETERS tuRow && @ identify the current row
IF m.thisForm.wlHTMLgen
RETURN .T.
ELSE
DODEFAULT(m.tuRow)
SELECT Units
SET FILTER TO pid = projects.pid
=THISFORM.grdunits.REFRESH()
ENDIF
Bests regards
Gilles
Thanks for both replies. We now understand the "splitting" idea but still need further clarification.
We put all the .AfterRowColChange event code in .wAfterRowColChange for both grids (Grid1 and GridUnits). We replaced <existing code> with Grid1 .AfterRowColChange event code. We do not know what to pass as tuRow. If turow is RECNO("projects"), then code could be DoDefault("RECNO("projects"))?
Grid1.wAfterRowColChange
IF NOT m.thisForm.wlHTMLGen
DoDefault(tuRow)
* <existing code>
SELECT Units
SET FILTER TO pid = projects.pid
thisform.grdunits.refresh
ENDIF
GridUnits.wAfterRowColChange:
Thisform.txtpid.refresh
Thisform.txtseq.refresh
Thisform.txtmodel_no.refresh
Thisform.txtselleach.refresh
Thisform.txtqty.refresh
thisform.txttonnage.refresh
Garth,
Tuvia's answer is absolutely right, I'll just expand a little more on that ...
.AfterRowColChange() triggers on either row change or column change; ActiveWidget's grid has 2 separate events for the same effect: row change and col change; having a 1-1 match between javascript and VFP events requires that you move your code processing row change to .wAfterRowChange() and/or your code processing column change to .wAfterColChange(), resulting in an empty .AfterRowColChange() method so that default aw.vcx!awGrd code executes (this default code ensures calling either .wAfterRowChange() or .wAfterColChange() when running in LAN mode).
tuRow is whatever data identifies current row, brought in by FoxInCloud Application Server, and processed by aw.vcx!awGrd::wRowChange() through the DoDefault(tuRow) instruction.
If your grid.RecordSource has a primary or candidate index key, it prevails on recno() used by default.
As index key may be of any type (mainly 'C' or 'I', but could be 'T' or whatever), parameter name is 'tuRow' follows VFP standard variable naming convention :
- 't' for parameter
- 'u' for unknown type
- 'Row' for Row identifier.
HTH,
thn
We are expanding our sample form by adding a classic table maintenance (add,edit,delete) form launched from a button on form1 (main). Our maintenance form has a parent grid and child grid. The parent grid (grid1.afterrowcol change) has the following code to display the child record associated with the parent record.
LPARAMETERS nColIndex
SELECT Units
SET FILTER TO pid = projects.pid
thisform.grdunits.refresh
We could have SET RELATION between the parent and child tables in the forms Init instead of SET FILTER in the grid's Event method.
FAA indicates that following manual change is needed:
Code for this event method must be split into before/afterRowChange() and before/afterColChange().
awGrd parent class code should execute:
IF NOT m.thisForm.wlHTMLGen
DoDefault(tuRow))
<existing code>
ENDIF
Split server code into wAfterRowChange() et wAfterColChange()
Our question is what does this message mean? what is meant by code for this event method must be split?
What is meant by awGrd parent class code should execute: IF NOT m.thisForm.wlHTMLGen
DoDefault(tuRow))
<existing code>
ENDIF
What is tuRow in DoDefault(tuRow))?
FAA has a similar message for the text field refreshes code in the child grid afterrowcolchangeevent method:
LPARAMETERS nColIndex
Thisform.txtpid.refresh
Thisform.txtseq.refresh
Thisform.txtmodel_no.refresh
Thisform.txtselleach.refresh
thisform.txtqty.refresh
thisform.txttonnage.refresh
How/where do we "split" these commands? What actually needs to be changed?
Thanks.
Garth