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

Home » RADICORE » How To » std.list3 passing middle table to child form
Re: std.list3 passing middle table to child form [message #386 is a reply to message #367] Thu, 09 November 2006 04:18 Go to previous messageGo to previous message
johandewit is currently offline  johandewit
Messages: 25
Registered: May 2006
Location: Belgium
Junior Member
Managed to get the data from std.lsit3 to the child form std.add2.

From the Menu, I call the std.list3. So, I needed a $where, which I create in the outer_class using the _cm_initialize function.

Since the logon_id is not a primary key in my user database, I needed to look this up to create the $where string using the primary key.

the code from the _cm_initialize function

if (!empty($_SESSION['logon_user_id'])) {
$where = 'log = "' . strtolower($_SESSION['logon_user_id']) . '"';
if ($this->getCount($where) == 1 )
{
$fieldarray = $his->getData_raw($where);
$where_array= $this->getPkeyArray($fieldarray);
$where = array2where($where_array);
} else {
$where= NULL; // not a regular user
}
}

[ Or should one use the Task Parameter 'Selection (fixed) in menu and RBAC system ? ]

The middel tabel is dericed from the inner table and contains mostly calculated fields. The problem I had, was that I needed to pass a calculated field, which is defined in the inner table, which is not a primary key.

When addin new records to the inner table, the fields from the middle table must be filled in already and changed to 'noedit' state.

Such data is passed using the $where string. This where string consist only of pkey fields. In the middel table, I modified the propertie $this->primary_key to include all fields nedded for the child form (std.add2 in my case). This is done in the _cm_changeConfig function in the middel_table_class.

IIs this the intended way for this situation, or are there better ways to achieve the same ?

Thanks

Johan




 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: File picker
Next Topic: Debug application
Goto Forum:
  


Current Time: Fri May 17 17:21:33 EDT 2024

Total time taken to generate the page: 0.00888 seconds