Thema: HTML5Builder

Einzelnen Beitrag anzeigen

manfred_h

Registriert seit: 4. Nov 2005
Ort: Basel
442 Beiträge
 
Delphi XE2 Enterprise
 
#1

HTML5Builder

  Alt 20. Aug 2013, 15:42
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...

Grüsse aus Basel
Manfred
  Mit Zitat antworten Zitat