This topic is locked
[SOLVED]

 List View (master) linking to multiple tabs (detail) -- how?

1/4/2012 3:34:34 PM
PHPRunner General questions
L
larryk author

hello, just bought phprunner -- so i'm stilling getting used to the lingo, names and working with the software.
I tried to search for the answer, as it seems some what easy, but didn't find it.... (besides I'm adding one additional feature)

  1. setting up a plain-simple master detail, where the master list view shows you the number of detail records.... currently right now, it shows (1), but when you hover on the link, it shows none?
  2. when I click on the link to go to the detail tab, in the url, I see '&masterkey1=' where its blank. if i add a 1 to the end, as in: .php?mastertable=customer&masterkey1=1, it works?
    So with those 2 items, obviously, I've done something wrong... but I can't figure out how/where to fix it. Shouldn't the default settings take care of that functionality?
    and 3) my added functionality, feature i"m trying to figure out as well.
    my situation:
    customer table (master)

    order table (detail)

    address table (detail)

    event table (detail)
    where I want the list view for customer to look like this:
    == listing of customer records ===
    Test Name - Order (2) Address (3) Event (1)- other customer data, etc
    so if you click Order, you go to the order tab to see the order detail records.

    <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=18639&image=1&table=forumtopics' class='bbc_emoticon' alt='B)' /> now, i also want a way to let the admin add a New detail record of ANY type of detail record ? how to do that?

    a couple Ideas I had....

    --- in the top menu, have a add new for each detail table type,

    --- or click a customer (check box or highlight) and then click the detail tab (once that happens it automatically goes to the add new screen

    --- or do something to tell the system to add a new detail record for a selected customer.
    hope all that makes sense!
    thanks for your help... i'm sure I will get the hang of phprunner, just as soon as I get over the learning curve <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=18639&image=2&table=forumtopics' class='bbc_emoticon' alt=':)' />
    PS. where are the system variable, ID fields, etc. kept? Any tips for a newbie on finding things? Like a cheat sheet?

    OR The most commonly used items in phprunner and where they are located? how/why to use them?

L
larryk author 1/5/2012

So I figured out some of my problems ---

(I had a little problem in my DB design --- put the key in both tables??? not sure what I was thinking)
anyway, when I did a test project, the default features work like they were supposed to (i had user error before)
so here is what I'm stuck on...

how can you pass/get the "Selected" records ID to pass to or insert a detail record?
thanks

L
larryk author 1/5/2012

lets try this...
how do you get the primary key (ID) from a selected row in the list view?
where/how do you access/get the ID field?
thanks

L
larryk author 1/5/2012

getting closer...
I'm pretty sure this will save some newbies to PHPR (that is phprunner) <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=63440&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

lots of time!!!
look here:

http://xlinesoft.com/phprunner/docs/page_life_cycle_overview.htm

http://xlinesoft.com/phprunner/docs/more_about_events.htm
i've seen lots of discussion about getting "selected rows" from a list view... but don't know how to get just 1 row yet...
I learned about a dummy field and using the custom view to make it a link... so part of the way there....
my goal --
on the list view page, add a link to ADD a detail record.

so the master record ID is passed to the detail add record page.
thanks if you have offer how to do this <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=63440&image=2&table=forumreplies' class='bbc_emoticon' alt=':)' />

C
cgphp 1/5/2012

You can access the primary key of selected rows with a button: http://xlinesoft.com/phprunner/docs/inserting_button.htm

L
larryk author 1/5/2012

Thanks Christian,
I see, understand that specific part...

but i'm lost as to the making it work.
I'm starting to understand the pieces, but I don't understand where/how those pieces fit together.
I guess I just need to get over the learning curve <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=63442&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />
FYI. i do like the explanations, docs, details, examples, etc. that I'm finding, its just that some of the items expect that I "ALREADY know" how the whole system works, etc.

Sergey Kornilov admin 1/5/2012

larryk,
what if you use a built-in functionality for this purpose? Link two tables as Master-Details and add details record either on the same master list page or on the separate page. Will that work for you?

L
larryk author 1/5/2012

Thanks, but in this situation -- no.
I just uploaded my project to the demo account and I opened a support ticket about 'buying support' <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=63444&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
i know what I'm doing is not hard, but I've spent all day trying to make it happen and i'm not there yet <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=63444&image=2&table=forumreplies' class='bbc_emoticon' alt=':(' />
I'm sure 1 or 2 hours on the phone would solve everything and more!!!
thanks

Sergey Kornilov admin 1/5/2012

A quick suggestion on how you can proceed to directly to Details Add page bypassing the Details List page.

  1. Use the following code in Add page: BeforeProcess event.

global $strTableName;

if ($_GET["masterkey1"])

$_SESSION[$strTableName."_masterkey1"]=$_GET["masterkey1"];

if ($_GET["mastertable"])

$_SESSION[$strTableName."_mastertable"]=$_GET["mastertable"];


2. Point user the following URL:

Cars_add.php?mastertable=Make&masterkey1=Audi


Assuming that master table is Make, and details table is Cars.