If I type this address on my browser :
http://localhost/productos/autocomplete/BEBE
I doesnot return any thinkg.
The SQL in the debug mode 2 tells me this
SELECT `Producto`.`id`, `Producto`.`linea_id`, `Producto`.`unidad_id`,
`Producto`.`plu`, `Producto`.`descripcion`, `Producto`.`costo`,
`Producto`.`porcentage`, `Producto`.`precio_lista`,
`Producto`.`created`, `Producto`.`modified`, `Producto`.`estaactivo`,
`Linea`.`id`, `Linea`.`nombre`, `Linea`.`estaactivo`, `Unidad`.`id`,
`Unidad`.`nombre`, `Unidad`.`factor`, `Unidad`.`estaactivo` FROM
`productos` AS `Producto` LEFT JOIN `lineas` AS `Linea` ON
`Producto`.`linea_id` = `Linea`.`id` LEFT JOIN `unidads` AS `Unidad`
ON `Producto`.`unidad_id` = `Unidad`.`id` WHERE descripcion LIKE ''
There is nothing after the LIKE.
This is my controller againg.
class ProductosController extends AppController
{
var $name = 'Productos'; // required for PHP4 installs
var $helpers = array('Html', 'Javascript', 'Ajax');
var $scaffold;
var $uses = array('Producto');
function autocomplete ()
{
$this->set('productos',
$this->Producto->findAll(
"descripcion LIKE '{$this->data['Producto']['descripcion']}'")
);
//$this->Producto->findAll("descripcion LIKE ''");
$this->layout = "ajax";
}
}
Does it have to return anthing If I call the address myself?
On 6/1/06, Carlos Mauricio Samour <[EMAIL PROTECTED]> wrote:
> My bad the ajax-autocomplete is working If I type something I can see
> the page doing a reloading but It is not returning any data.
> I wonder if my controller is set up correclty. Or I am calling the right view.
>
>
> On 6/1/06, nate <[EMAIL PROTECTED]> wrote:
> >
> > Well, if you added 'Javascript' to the list of helpers in your
> > controller, but the $javascript helper variable is not set, that means
> > Cake is throwing an error of some kind, usually related to it not being
> > able to find something.
> >
> >
> > > >
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---