Welcome, Guest
Username: Password: Remember me

TOPIC: Dynamic list with foreign key

Dynamic list with foreign key 15 May 2012 19:46 #2357

  • msr43
  • msr43's Avatar
  • Offline
  • New Member
  • Posts: 19
  • Karma: 0
Unable to generate a dynamic list field using the foreign key.It shows up a simple textbox instead of the combo box with the values from the foreign table.

Regards
MSR
The administrator has disabled public write access.

Re: Dynamic list with foreign key 16 May 2012 03:47 #2360

  • msr43
  • msr43's Avatar
  • Offline
  • New Member
  • Posts: 19
  • Karma: 0
Finally I figured it out...It works great...

Only issue is that it pulls up all the data from the foreign key table.Even with rows mentioned as UnPublished in the foreign key table but it honors with view access level.

Also, Can I pull up only a subset of value from the foreign key table by using a where clause?

Usecase:

For Example all the reusable lists in enterprise application comes from one table and we call it as a lookup table.When querying the data for the specific list, we will add the where clause dynamically to filter the data.

Regards
MSR
The administrator has disabled public write access.

Re: Dynamic list with foreign key 19 May 2012 11:14 #2380

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
The preparation of the data is processed in the View File.

Directly in the view, you can add a Where statement to the model that is queriing the datas.

For instance :
$myModel->addWhere('a.foo = ' . (int)$myValue );
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.077 seconds

Get Started