Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Developing sample app

$
0
0
Re: Developing sample app
FoxInCloud
Re: Developing sample app
03/05/2012
06:21:19 AM
3G50DMIA4 Show this entire thread in new window
Gratar Image based on email address
From:
To:
Attachments:
None
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





Viewing all articles
Browse latest Browse all 10393

Trending Articles