This topic is locked

Displaying Details table data on Edit page of Master

3/15/2010 5:05:18 PM
PHPRunner General questions
J
jacekq author

Hello,
I've 2 tables: Orders(master) and Customers(details) joined by id_users column in Orders to id column in Customers.

Orders edit page should enable users to change some data except the customer's name. I've reviewed topics in forum so the solutions are the following:

  1. by using Lookup table settings on id_users column - it is not OK in my case
  2. make id_users as readonly field and change template's variable in edit page event procedure 'Before display' - there is unprecise information in PHPR online help on two areas:
    a. $xt template variable is NOT changed by $xt->assign("id_users", $data['company name']) but by $xt->assign("id_users_editcontrol", $data['company name'])!
    b. I can't access DAL class as it is described in the manual. I mean:



global $dal;

$dal->Customers->Query(....)



is not working because of errors: there is no method Query in $dal class

So I had to use older solution:



global $conn, $data;

$query= "select * from customers where id=...";

$rs = db_exec($query,$conn);

.....


Maybe I dont know something important...
Regards,

Jacek

Sergey Kornilov admin 3/15/2010

Jacek,
DAL syntax has changed in version 5.2. You need to see PHPRunner 5.2 manual in this regards:
global $dal;

$dal->Table("Customers")->Query(....)
PS. DAL code in older projects is converted automatically.

J
jacekq author 3/17/2010

Hello,
There is an error in the PHPR 5.2 manual. You wrote:



DAL syntax has changed in version 5.2. You need to see PHPRunner 5.2 manual in this regards:
global $dal;

$dal->Table("Customers")->Query(....)


but according to the manual syntax should be:



$dal->Table["Customers"]->Query(....)



square parentheses are not working!
Jacek