Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/02/2012, 08:26
Avatar de 8461277
8461277
 
Fecha de Ingreso: diciembre-2002
Ubicación: san juan de los morros
Mensajes: 887
Antigüedad: 21 años, 4 meses
Puntos: 1
Funcion editar, problema con campos de tipo SELECT?

Buenos dias compañeros del foro, tengo un pequeño problema con una funcion de editar REGISTRO SEGUN LA FECHA ESCOJIDA.

Tengo en el controlador esta fucnion de modificar(editar):

Código PHP:
function editar($idnull){
        
$this->Bauche->recursive=2;
        
$this->Bauche->id $id;
            if (empty(
$this->data)) {
            
$this->data $this->Bauche->read();
            
    } else {
            if (
$this->Fechadeposito->save($this->data)) {
            
$this->Session->setFlash('Your post has been updated.');
            
$this->redirect(array('action' => 'index'));
       }
     }
    }
//fin editar 
En la vista tengo este formulario:
Código PHP:
<fieldset>
<legend><?php __('EDITAR registros por Fechas');?></legend>
<?php
echo $form->create(null, array('url' => '/inicios/editar'));
echo 
$form->input ('Bauche.0.fechadeposito_id', array('label' => '<font color=black><b>ID fecha deposito</b></font>','size' => '10','class' => 'validate[required] text-input')); 
echo 
$datePicker->picker('Fechadeposito.fecha', array('id'=>'fechaDeposito','type' => 'text''size' => '10','label' => '<font color=black><b>Fecha Deposito</b></font>','id'=>'fecha_deposito','name'=>'data[Fechadeposito][fecha]','readonly' => 'readonly','class' => 'validate[required] text-input''onfocus'=> true));

echo 
$form->select('Bauche.0.banco_id',$selectBanco,nullnullfalse); <---aqui debe estar la agencia bancaria

echo $form->input ('Bauche.0.num_bauche', array('label' => '<font color=black><b>Numero Vauche</b></font>','size' => '10','class' => 'validate[required] text-input')); 
echo 
$form->input ('Bauche.0.monto', array( 'label' => '<font color=black><b>Monto Depositado</b></font>','class' => 'validate[required] text-input')); 
?>
</fieldset>
<?php
echo $form->submit ('Buscar!');
echo 
$form->end();
Si le paso el id de la id de la tabla Bauches para verificar q fecha, nume vauche, monto etc me arroja esto:



Si observa me trae todos los Datos excecto la AGENCIA BANCARIA (flecha roja)

Que estoy haciendo mal, para q el metodo read() no devuelva a traves de $this->data al formulario la agencia bancaria?????
__________________
Miguel Padrón :cool: