Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to refresh a pg-4 grid based on a cell in startup pg
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00160857
Message ID:
00160904
Views:
21
>When the user goes to the 4th page on the form, I need the grid on page-4 to be refreshed with data pending on a REQUERY() based on a cell on the startup page. The page-4 grid uses a different view than the startup page's grid. I have tried three different scenarios.
>

I assume you mean that you want the grid on page four populated based on the "RECORD" selected on the page one grid... not a "CELL"

You want this to work like the Projects screen in projects manager... just follow the sample...

The bizobj on page four cListObj1 has the following properties...

cParentBizObj = clistonetomany (this is the bizobj on page 1)
nRequeryType = 1 (this tells it to requery if the primary ID has changed)
cUniqueIDField = cID (this is the unique field in the primary bizobj's view that the child bizobj checks to know if the parent record is different. If it is, and nRequery is 1, the bizobj will be requeried.)

PostInitHook Code...

This.aViewParameters[1,VPARM_NAME] = 'vp_cProjectID'
This.aViewParameters[1,VPARM_EXPR] = 'v_Projects.cID'

This is what links the view for page four to the view on page one. (There is another way to do it too)

Now.. look at the lv_projecttasks view... Look at the filter.

Now, follow what happens:

You select a record on the grid on page one. You click on page four. The framework looks at the cID field of the alias of the initialselectedalias of it's parent bizobj. It sees that the value of cID is different than the last time page 4 was activated.

So, it requerys the bizobj... when a bizobj is requeried, it checks to see if aViewParameters has anything in it. In this case, it does... (populated in the post init hook)

So, the bizobj takes the value of v_Projects.cID and puts it into vp_cProjectID, which is the view parameter of your page 4 view. Then, the view is requeried. All the tasks for the selected project on page one are displayed.

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform