Further along ...
1. We put the record source definitions for both parent and child tables in the form's init with no obvious difference. 2. We replaced the set filter parent/child table link with a set relation link. This works as expected in VFP IDE, but in browser, child table grid shows all child records. We added expression (Projects.domain+ Projects.pid) to relational expression property in child grid - no change. How can we show only the child record associated with parent table records in browser?
3. For our convenience, we added the FAA app (awadapterstart) to our project. This works fine except when we hit Run, we get a messages "There is no disk in the drive ....".
4. When FAA comes up and we hit "Adapt" we get repeated messages, "The Acrobat Reader that is running cannot be used to view PDF files in a Web Browser. ..." Acrobat is not running and we have the default set to PDF-XChange Viewer.
5. When we run xxxtest.prg to tst the app in a browser, we get the message "Alias name already in use" twice. We hit ignore and are able to proceeded and test the app in the browser anyway.
6. We had to put replicate our wAfterRowChange() code under AfterRowColChange to make the app work in VFP IDE. We verified that wAfterRowChange() is not being run in VFP IDE by adding a SET STEP ON to the method.
7. Here is some feedback from our client to our FoxInCloud screens.
Good..
For both running in LAN and WEB mode you dont have to use AfterRowColChange only wAfterRowChange().. my applications are running into the two modes under FIC/FAA..
Performance are more better when the application EXE is running in COM MODE. In FIC/FAA/VFP IDE it's more slower than in COM mode..
Best regard
Thank you.
Success! We reverted back to the original sample app and add the desired controls one at a time and testing each build. Everything is now working as expected!
Performance is not as snappy as in VFP IDE but it 's OK. We will address this next. To speed things up, we will now change the app so that our two tables are in a database container, related by SET RELATION.
We are likely running in File mode at the time. Once in production, COM mode can be used and the app should be pretty responsive. Thierry discussed how to implement grid table relations in a prior posting on this forum.
We will also look into putting the record source in the grid in the form's init event.
We also need to make the afterrowcolchange grid event method operate on a condition check for VFP IDE mode. Our completed app must be running on both the desktop and the web.
Tomorrow we will ask a few questions regarding messages that come up when running FAA and test run start up that prevent us from automating (walking away) the process.
Thanks again for your help.
Garth
is the recordsource of the grid designed in the VFP IDE ?
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