Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   HTML5Builder (https://www.delphipraxis.net/176223-html5builder.html)

manfred_h 20. Aug 2013 15:42

HTML5Builder
 
Hallo zusammen

Habe das Problem das ich mit einer MList Daten aus einer MySQL DB holen und
dann auf einer 2ten Seite gerne die Details hätte.
( In der MList sind nur die Namen, für die Adresse hätte ich gerne die 2te Seite )

Das Problem ist das Die "Details" ( basiert auf der gleichen Tabelle ) nicht gefiltert werden. Es wird immer der erste Datensatz angezeigt.

( Basiert auf diesem Bsp. von Embarcadero )

Das Füllen der MList geht gut.
Code:
    function memberBeforeShow($sender, $params)
    {
         function fillMList($sender, $params)
            {
            global $dm;
//                 Get the items array from the MList (you cannot work with the property directly).
                $items = $this->MList1->Items;

//                 Add all the item to the items array.
//                 NOTE: items are associative arrays, see the documentation of the Items property.
                   $this->$dsMEMBER->DataSet->first();
                   while( ! $this->$dsMEMBER->DataSet->EOF )
                   {
                          $items[] = array("Name" => $this->$dsMEMBER->DataSet->Fields["F_NAME"]);
//                     NOTE: This example adds an item with the value of its caption field filled with the value
//                     of the ‘column_name’ column from the DataSource.
//                     See the documentation of the Items property for a list of available item fields.

                          $this->$dsMEMBER->DataSet->next();
                   }

//                 Save the items array back to the property.
                $this->MList1->Items = $items;
            }
    }
Beim anklicken der MList wird dies ausgeführt:
Code:
    function MList1Show($sender, $params)
    {
        $items = $this->MList1->Items;
        for($i = 0; $i < count($items); $i++)
        {
        $items[$i]['Link'] = 'member_detail.php?id='. $items[$i]['Link'] ;
        }
        $this->MList1->Items = $items;
    }
Auf der Detailseite wird folgendes aufgerufen:
Code:
    function member_detailPageCreate($sender, $params)
    {
     if( !empty($_GET['id']))
        {
        global $dm;
        $this->$dsMEMBER->close();
        $this->$dsMEMBER->filter = "ID=" . $_GET['id'];
        $this->$dsMEMBER->open();
        }
    }
Wäre schön wenn ich eine Lösung finden würde.
Habe schon überall Gegoogelt...:oops:

Grüsse aus Basel
Manfred


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:29 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz