form navigation: list->record->record

Questions, tips and tricks and techniques for scripting in Servoy

form navigation: list->record->record

Postby Neale » Wed Aug 06, 2003 3:46 am

I'm getting lost here :-(

Starting with a list view form, showing a foundset, I need to be able to navigate from that list view form to a record view form and from there to a different record view (but displaying the same record). I've got things "working", but I'm far from convinced that what I'm doing is correct/best...

First, conceptually, when I navigate from the list view to the first record view (via a button which is part of each record displayed in the list form) should I retain the current foundset as-is or does/should the foundset reduce to just the selected record?

Assuming the latter, is it correct/best to relate the table to itself and use showRecords(relation_to_self) to navigate from the list to the record view?

Alternatively, what would be the correct/best way if it's appropriate to NOT mess with the current foundset - just a show() or precede the show() with a loadRecords(Object) or what? BTW, what is valid for "Object" in loadRecords(Object)?

Similarly, what would then be the correct/best way of navigating from that record view to a different record view?

Thanks,
Neale.
Neale
 
Posts: 230
Joined: Thu May 15, 2003 6:29 am
Location: Australia

Postby Jan Blok » Wed Aug 06, 2003 12:01 pm

Some facts:
-a foundset has a selected record
-listview show all records highlighting the selected, recordview only shows selected record

So it is possible to retain current foundset as is, in the listview_form make a method with: forms.recordview_form.controller.showRecords(foundset) this takes the foundset from the listview_form and puts the records in the recordview_form showing the selected record.

but forms based on the same table share the same foundset (unless useSeparateFoundset property is used) so the the recordview_form had already the foundset (assuming you did not use the property) so forms.recordview_form.controller.show() whould be sufficient

Only when you want to make sure the recordview_form contains 1 record a selfjoin is needed i.e. forms.recordview_form.controller.showRecords(relation_to_self)
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby Neale » Fri Aug 08, 2003 7:10 am

Thanks for the clarification.

Regards,
Neale.
Neale
 
Posts: 230
Joined: Thu May 15, 2003 6:29 am
Location: Australia


Return to Methods

Who is online

Users browsing this forum: No registered users and 11 guests