title: Saving data from JModelList (Joomla 3)
body: <p>in the moment I'm trying to save the following table:</p>
  
  <p><a href="http://img5.fotos-hochladen.net/uploads/tabelle1k6xegf4tm.jpg" rel="nofollow">http://img5.fotos-hochladen.net/uploads/tabelle1k6xegf4tm.jpg</a></p>
  
  <p>Only the -fields needs to be saved when I click on the blue button below the table.
  My problem: I'm new at joomla and dont know to how to save this.
  Am I using the right Classes?
  Is it possible to solve this by an table-class?
  Maybe someone can send me an component where something like this is solved?
  Or can give me the right code samples?</p>
  
  <p>Here you can find what I've done:</p>
  
  <pre><code>class TippspielModelTippview extends JModelList 
      { 
          protected function getListQuery() 
          { 
              //Erstelle ein neues Query-Objekt 
              $db= JFactory::getDbo(); 
              $query= $db-&gt;getQuery(true); 
  
              //Hole alle Daten 
              $query-&gt;select('t2.id, t2.date, t2.goalsteam1, t2.goalsteam2, t1a.team AS mannschaft1, t1b.team AS mannschaft2'); 
              $query-&gt;from('#__tournament AS t2'); 
              $query-&gt;join('left','#__team AS t1a ON t2.team1 = t1a.id'); 
              $query-&gt;join('left','#__team AS t1b ON t2.team2 = t1b.id'); 
              $query-&gt;order('date'); 
  
              //und liefere es zurück 
              return $query;         
          } 
  
      }  
  </code></pre>
  
  <p>The View</p>
  
  <pre><code>class TippspielViewTippview extends JViewLegacy 
      { 
          //Variable zur Speicherung aller Teams 
          protected $pages; 
          protected $games; 
  
          function display($tpl = null) 
          { 
              //Hole Daten aus dem Modul 
              $this-&gt;games = $this-&gt;get('Items'); 
              $this-&gt;pages = $this-&gt;get('Pagination'); 
  
              //Layout aktivieren und ausgeben 
              parent::display($tpl); 
          } 
      }  
  </code></pre>
  
  <p>The Form</p>
  
  <pre><code>&lt;form action="&lt;?php echo JRoute::_('index.php?option=com_tippspiel&amp;view=tippview'); ?&gt;" method= "post" name="adminForm" id="adminForm"&gt;
      &lt;?php echo $this-&gt;pages-&gt;getLimitBox(); ?&gt;
      &lt;table class="table table-striped"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;Heim&lt;/th&gt;
                  &lt;th&gt;Gast&lt;/th&gt;
                  &lt;th&gt;Spielbeginn&lt;/th&gt;
                  &lt;th&gt;Tipp&lt;/th&gt;
                  &lt;th&gt;Ergebnis&lt;/th&gt;
                  &lt;th&gt;Punkte&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
               &lt;?php foreach($this-&gt;games as $i =&gt; $game): ?&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;?php echo $game-&gt;mannschaft1; ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $game-&gt;mannschaft2; ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo JHtml::date($game-&gt;date); ?&gt;&lt;/td&gt;
                      &lt;td&gt;Tipp&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $game-&gt;goalsteam1; ?&gt; : &lt;?php echo $game-&gt;goalsteam2; ?&gt;&lt;/td&gt;
                      &lt;td&gt;Punkte&lt;/td&gt;
                  &lt;/tr&gt;
               &lt;?php endforeach; ?&gt;
          &lt;/tbody&gt;
  </code></pre>