Event Triggering on ListView redisplay

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Event Triggering on ListView redisplay

Postby JerryR » Tue Sep 07, 2004 8:40 am

This question requires a bit of setup, so please bear with me!

I have a three-level deep relational hierarchy: Customers, Jobs, and Uploads. I have defined three forms (all table views), one each for each of these tables. All three table views show in tabless tab panels on a fourth form called 'main'. Main is based on the Customer table. The Jobs table view tab panel is related to Customers via a cust_sn that appears in both files. Uploads is related to Jobs via a relationship with a global field on the left that gets populated with the job_sn when triggered by the OnRecordSelected event.

The goal is to select a customer in the top table view, have that result in the display of that customer's jobs in the second table view, and have the selected job in the second table automatically result in the display of the uploads for that job in the third table view. When you click back and forth between customers in the top tab panel, the jobs tab panel correctly shows that client's jobs. Here's the problem: This changing of displayed jobs in the second tab panel does *not* result in an OnRecordSelected event on the jobs form, so the Uploads tab panel never displays anything unless you manually click on a row in the jobs table view. Questions: Is there any way to trigger this? Is there a better way to set up the relationships so I don't have to resort to sticking the value of job_sn in a global when the user clicks on a job row to force the appropriate display in the Uploads table view?
Jerry Robinson
JPR Engineering Inc
JerryR
 
Posts: 104
Joined: Sat Jan 17, 2004 4:30 am
Location: Pacific Palisades, CA

Postby JerryR » Tue Sep 07, 2004 7:10 pm

Addendum to above. Had been testing with only two customers, one with jobs and one without jobs. Going from the customer with jobs to one without and back again results in nothing displayed in the Uploads tab panel table-view. If I go back and forth between two customers who have jobs, everything works fine! I'm guessing this means that OnRecordSelected is *not* firing when the same 'Jobs' recordset is redisplayed after an empty (as opposed to different) recordset is displayed. Can this be fixed?
Jerry Robinson
JPR Engineering Inc
JerryR
 
Posts: 104
Joined: Sat Jan 17, 2004 4:30 am
Location: Pacific Palisades, CA

Postby JerryR » Tue Sep 07, 2004 7:50 pm

Addendum 2: OK. I think I can now ask the question in a more generic way. In the case where one is using a table view in a tabless tab panel to emulate a portal--in other words--the records displayed in the table view are determined by a relationship--is there any event associated with the table-view form that fires when the displayed set of records changes?
Jerry Robinson
JPR Engineering Inc
JerryR
 
Posts: 104
Joined: Sat Jan 17, 2004 4:30 am
Location: Pacific Palisades, CA

Postby bcusick » Tue Sep 07, 2004 11:43 pm

Hi Jerry,

onShow (form level) when the listview form is drawn in the enclosing form;

onRecordSelection (form level) on the listview when switching from one record to another;

onHide (form level) when the listview form is going to be hidden (when navigating away from the enclosing form)

Hope this helps,

Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Postby JerryR » Wed Sep 08, 2004 12:27 am

Hi Bob.

The table view is displayed in a tabless tab-panel on a 'master' layout and thus is always visible. That lets out OnShow and OnHide. The records being displayed are controlled by a record selected in another tabless tab-panel -- that means that in a case where you are going from records displayed in the target tab panel to no records displayed and back again, the OnRecordSelected event does *not* trigger. That's where I'm stuck. Can't come up with an event that triggers in these circumstances.
Jerry Robinson
JPR Engineering Inc
JerryR
 
Posts: 104
Joined: Sat Jan 17, 2004 4:30 am
Location: Pacific Palisades, CA

Postby jcompagner » Fri Sep 10, 2004 3:38 pm

are you saying that you want an even when it gets new records? When a new foundset is set?

I still can't see the complete picture what the states are at the specific times..
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby JerryR » Sat Sep 18, 2004 10:54 pm

Johan, I'm going to take another stab at this.

I'm either talking about modifying the functionality of 'OnRecordSelected', or adding a more complicated version ('OnRecordSelectedChanged'). The new version adds the following functionality: In addition to triggering when the user clicks on a record in a list or table or when some external event results in changing the foundset from one group of records to another, it also triggers if...

1. The displayed recordset suddenly has no records in it. (In essence, this amounts to a change in the selected record because what was the selected record isn't in the set anymore.)

2. The displayed recordset has records in it (including a selected record), is changed to a set with no records in it, and then changed back to the identical first set (which will have the original record still selected). To my way of thinking, this amounts to a change in the selected record because there is no selected record when the foundset is empty, but is one once the foundset is restored.

Thoughts?
Jerry Robinson
JPR Engineering Inc
JerryR
 
Posts: 104
Joined: Sat Jan 17, 2004 4:30 am
Location: Pacific Palisades, CA


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 33 guests