• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Data missing in list page of custom module

M

MiriamK

Guest
Hi,

I am new to plesk module development. I have a new requirement to develop a module for listing and selecting some items. I have used the following code to list the items.
--------------------------------------------------------------------------------
file: mylist.php
<?php
class mylist extends pm_cList {
function fetchmylist() {

$this->columns_ = array();
$this->list_ = array();

$this->columns_ = array(
'0' => array('name' => 'ItemName', 'sort' => 'ItemName'),
);

$productslist = db_query('SELECT ItemName FROM module_my_items');
while($row = db_fetch_assoc($productslist)) {
$this->list_[] = $row;
}
function ItemNameGet() {

}
}
?>
My list_ array is:
Array
(
[0] => Array
(
[ItemName] => item 1
)

[1] => Array
(
[ItemName] => item 2
)
............
)


--------------------------------------------------------------------------------
In index.php, I use the following code to fetch the list which is assigned to the template variable for display.

$list = new mylist;
$list->setFSP('setPage');
$list->init();
$listdisplay = $list->get();
--------------------------------------------------------------------------------

When I run this code I am getting the "list template" correctly. I mean only the template structure is shown, with no data listed. When I debugged the code, I could see that the count of table rows and the column headings are correct. Please let me know which function do I need to call, otherthan $list->get(), to get the listing correctly. I could not trace which function will display the item names.

Thank you,
Miriam
 
Back
Top