I am working on a farm management app, and have a quick combo box
automagic question.
Because fields (a grouping of a crop/acres/harvest yields) vary
greatly from year to year, I have decided its best to create a new set
of all fields each year.
The user needs to be able to create events for a field, when the user
creates an event such as a chemical (fertilizer/pesticide/etc) event,
they select the field that it should be added to in a automagic combo
box. I need to filter the drop down box so that it only shows the
fields from the current season. below is my controller code:
function addChemical()
{
if(!empty($this->data))
{
if($this->Event->save($this->data))
{
$this->Session->setFlash('Event Created');
$this->redirect(array('action'=>'chemical'));
}
}
$this->set('fields',$this->Event->Fields-
>findAllBySeason('2010'));
$this->set('chemicalChemicals',$this->Event->Chemicals-
>find('list'));
$this->set('chemicalMeasurementsRates',$this->Event-
>Measurements->find('list'));
$this->set('chemicalMeasurementsPers',$this->Event-
>Measurements2->find('list'));
$this->set('chemicalImplements',$this->Event->Implements-
>find('list'));
$this->set('fieldFilter',$this->Session-
>read('fieldFilter'));
}
It seems to only return the fields in season 2010, but instead of just
giving me the field name like it did when I put in find('list') it
populates every field into the drop down which is definitely not what
I want.
*Note, for now I am using a hard coded date for testing.
Also, I was wondering if anyone knew of a good cakephp book?
Thanks
Travis Marble
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" 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?hl=en