This topic is locked
[SOLVED]

 Show child links on list only if child records exist

3/20/2009 1:31:01 PM
PHPRunner General questions
J
jetacera author

I have a master table called courses (primary key: cid). It has 3 child tables connected to it via the cid: coursediscounts (key: did), coursespecials (key: sid), and coursepackages (key: pid). On the courses list page, I only want the link for the child tables to appear if they have a record in them. If there aren't any records, I want the cell where the link would appear to be blank (no link).
For example, say Course ABC has records in coursediscounts and coursepackages, but no records in coursespecials. The links for coursediscounts and coursepackages, but nothing would appear under coursespecials.
I'm sure this is accomplished using some type of event. Please help.
FYI, I'm using PHPR 4.2 with a MySQL database if that makes a difference.
Thanks,
JET

J
Jane 3/23/2009

Hi,
please check this option on the Datasource tables tab in PHPRunner 5.0.

J
jetacera author 3/25/2009

I don't see this option in 5.0 - I don't see anything to check at all other than turning off parent/child table connections which is not what I want.
Let me further explain what I'm wanting to clarify more:
Example: 3 records in the courses table. Course A has records in child table coursediscounts, coursespecials, and coursepackages. Course B has records in coursediscounts and coursepackages. Course C has records in coursediscounts and coursespecials. Now on the courses list page I want to see something like this:


I want the links for the child tables to appear, but only for the child tables that have associated records in them for the parent. If there are no records for the parent table, I want just the link to disappear for that course record only. In my example above Course B doesn't have any child records in Course Specials, so the link does not appear, but the other child tables links do. Course C doesn't have any child records in Course Packages, so the link does not appear, but the other child table links do.
I would really prefer to continue using 4.2 since everything else is already working properly using that version (why fix something that isn't broken, you know what I mean?)

J
jetacera author 3/25/2009

OK, I looked around some more in 5.0 and found the checkbox you were talking about. \
However if I switch over to 5.0, then I have the problem that on every Edit page, after you edit the record and save that the page comes back empty and I need to return to the list page and reclick on the Edit link to get back to my changed record. Once I discovered this issue with 5.0 I went back to 4.2 because I found it extremely annoying and time wasting, regardless of the other nice new features in 5.0. In addition, I would have hours of additional work to remake everything in 5.0 since this project was initially done in 4.2 (before 5.0 came out) and what I'm working on now is an update with just a few changes.
That said, is there a solution to accomplish this in 4.2?
If not, is there a fix to the issue with 5.0 so that after editing a record it would return to the edited record with the "Record updated" message rather than a blank edit page?
Your assistance on this would be greatly appreciated.
Thanks.
JET

J
Jane 3/27/2009

Hi,
please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages and I'll try to help you with error on the edit pages.