Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC:

flypages with different sql request 09 Apr 2014 16:50 #12402

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
Hi admin,

so I troubleshoot my custom code problem, and I will try to resume:

This page starts the debug from views/portee/view.html.php where I add my custom code as described before.

liubov.net/joomla32/porteesattendues/por...orteattendue?cid=748
  • I have a doubt about the constructor name "com_jbreeding.pedigrees.porteattendue", because there is no relative context/layout in pedigrees. Is it a problem ?
  • as you can see, the build query works fine (addselect, addquery, etc) ... But at final, $query is 'null'.
  • In function getListQuery(), I add an exit; just before the return $query to stop the process here
  • If I remove the exit;, Jdatabase failed in 'Invalid query' because of 'null'
hoping it is clear enough !

Here, you can see the debug with a good getListQuery() : liubov.net/joomla32/porteesattendues

Please Log in or Create an account to join the conversation.

flypages with different sql request 21 Apr 2014 14:41 #12410

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
Hi admin and cookers ...

This is the results my search :

Subject : In an Item_view, how to get datas list from another TABLE:
views\portee\view.html.php
	// Initialiase custom code to get previous puppies from TABLE Pedigrees.
	$model_pedigrees = CkJModel::getInstance('pedigrees', 'JbreedsimpleModel');
		
	// set ModelPedigrees context
	$model_pedigrees->Setstate('context', 'pedigrees.previouspups');
		
	// set the WHERE Clause reference to Item_view
	$model_pedigrees->addWhere("a.pere = " . (int) $item->etalon) ;
	$model_pedigrees->addWhere("a.mere = " . (int) $item->lice) ;
		
	// execute the query.select and get the datas list
	$this->items	= $items	= $model_pedigrees->getItems();

works fine !

Please Log in or Create an account to join the conversation.

Last edit: by liubov.
  • Page:
  • 1
  • 2
Time to create page: 0.327 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started