Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Calling List2 from a List2
Calling List2 from a List2 [message #2368] Mon, 16 November 2009 04:25 Go to next message
ljkbrost is currently offline  ljkbrost
Messages: 59
Registered: April 2006
Member
Hi,

I have a grandparent->parent->child relationship for a network monitoring database. The tables are:

Device
device_id
device_name

DevicePort
device_id
port_id
port_speed

PortMonitor
port_id
monitor_date
monitor_counter

I have create a list2 screen with:
outer_table = Device
inner_table = DevicePort

On this list2 screen I would like to create a navigation button called "Monitoring Data". You select the port from the current list2 screen, click the button and are sent to a new list2 with:

outer_table = DevicePort
inner_table = PortMonitor

When I implement this structure, my second list2 transaction is only sent "device_id" and NOT "port_id". I get the error message that the parent has not been selected.

If I change the screen to a list3, it works fine.

I don't want the complexity of a list3 at this point and I would like to go from a list2 to another list2.

How can I do this?

Thanks,


Kyle Brost
----
www.SoftElephant.com
Re: Calling List2 from a List2 [message #2369 is a reply to message #2368] Mon, 16 November 2009 04:39 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2369
Registered: April 2006
Location: Surrey, UK
Senior Member
When you select occurrences of 'DevicePort' and press a navigation button the framework will extract the primary key from every selected row and place it in the $where string which is passed to the next object. If the primary key of the 'DevicePort' table is 'device_id+port_id' then both values should be included.

If 'port_id' is being excluded then it is one of the following:
(1) It is not defined as part of the primary key, therefore is not being extracted into the $where string.
(2) It is being extracted, but somehow it is being filtered out.

If it is #2 then you will have to step through the code with your debugger so see where it is happening.


Re: Calling List2 from a List2 [message #2370 is a reply to message #2369] Mon, 16 November 2009 04:45 Go to previous messageGo to next message
ljkbrost is currently offline  ljkbrost
Messages: 59
Registered: April 2006
Member
So based on my table layout would you say my primary key is:

1) port_id
2) device_id, port_id

I ask because #1 above gives me the same problem and #2 allows it work. I was thinking that device_id is a foreign key.

Thanks.
Re: Calling List2 from a List2 [message #2371 is a reply to message #2370] Mon, 16 November 2009 07:24 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2369
Registered: April 2006
Location: Surrey, UK
Senior Member
Your table layout does not identify the primary key, which is why I asked the question.

(1) What is being extracted into the $where by the 1st LIST2 task?
(2) What is being filtered out of the $where string by the 2nd LIST2 task?

That is why I asked you to step through with your debugger to see what is happening and where.

You might also want to take a look at Passing context between objects.


Re: Calling List2 from a List2 [message #2372 is a reply to message #2371] Mon, 16 November 2009 20:04 Go to previous messageGo to next message
ljkbrost is currently offline  ljkbrost
Messages: 59
Registered: April 2006
Member
Thanks for the insight I will review and see what is happening.

What debugger/editor do you use to step through things?

I'm using the good old 'print' statement for much of my debugging.
Re: Calling List2 from a List2 [message #2373 is a reply to message #2372] Tue, 17 November 2009 04:15 Go to previous message
AJM is currently offline  AJM
Messages: 2369
Registered: April 2006
Location: Surrey, UK
Senior Member
I use the debugger which comes with Zend Studio, but I used to use PHPEdit.

If you google 'php debugger' you will see other options that are available.

Once you use an interactve debugger you will never go back to primitive 'print' statements.


Previous Topic: Use a blank controller
Next Topic: Multiple Checkbox Control
Goto Forum:
  


Current Time: Mon Nov 25 12:56:22 EST 2024

Total time taken to generate the page: 0.01145 seconds