This topic is locked

Hide Rows In Child Table Based On Value From Master Table

1/17/2013 3:08:07 PM
PHPRunner General questions
C
copper21 author

Hello,
Having a bit of trouble getting this to work. I am trying to hide rows on the child inline add page based on a value from the master it is attached to. I know I can get values from the master into the child by using "process record values" event. That part works great. Now what I would like to do is if one of those values I am trying to add to the child record is NULL, make that row in the child inline add table disappear.
I have tried almost everything. The one thing I tried that kind of works is using:
List Page: Before Process
global $conn, $strTableName;

if ($_SESSION[$strTableName."_masterkey1"])

{

$str = "select * from training_topic_acknowledgement where topicid =".$_SESSION[$strTableName."_masterkey1"];

$rs = db_query($str,$conn);

$data = db_fetch_array($rs);
$_SESSION["question1_session"] = $data["question1_answer_type"];
List Page: Before Display
if($_SESSION["question1_session"] != NULL)

{

$xt->assign("question1_fieldcolumn",false);

$xt->assign("question1_type_fieldcolumn",false);

$xt->assign("question1_choice_fieldcolumn",false);

$xt->assign("question1_choice_literal_fieldcolumn",false);

}
This works, but the only problem is that when I click on the little red box with an X in it to cancel the inline child add and then try adding it, the session variable seems to have lost its value and this does not work. I am assuming that is because when the master list page is ran, the session variable is populated, but then if I close the child inline add and then reopening it I am unsetting the session variable. Is there a way to keep the session variable "alive" or am I approaching this the wrong way?
Thanks,
Brian