Re: using one select box to generate the results for two more
G'day Just for closing, restructure of the table was required, then the folks I was doing this for dropped the requirement On Nov 16, 8:08 am, ldb [EMAIL PROTECTED] wrote: G'day Ah, should have mentioned, I can restructure the table if that is needed, was trying not to. Been through too much trying to figure this one out, restructure would have to be less trouble if it makes Cake happier and works better within it's format. Thanks...;-) On Nov 16, 8:04 am,ldb[EMAIL PROTECTED] wrote: G'day Thanks. I have already applied the setup from devmoz, it was very helpful and I have the example working and another copy where the two tables involved actually can use a belongs to just as an extra test. I have likely not explained this fully, sorry. I have a table with model numbers other info on the products called models, then I have a table which only contains three columns, ID, Model Number and Other Model Number called Altmodels, so that items that are comparable could be looked up and interchanged. The ID number is an autoincrement, Model Number and Other Model Number can occur several times in all possible combinations. Any reference to the codes would point back to the Models table, it's really just a kind of index. I could not determine a fit with the associations ( I could be missing something there) so I set up the generateList to accommodate this and realized that upon load, how do I tell the lower two lines the model code selected by default? Or can I. Maybe I am on the wrong track with that part and don't need those lines? I am using scriptaculous and have verfied that it is working within this cake project. I have done PHP b ut just started with Cake, I figure I'm abusing it but not sure how. On Nov 16, 1:44 am, francky06l [EMAIL PROTECTED] wrote: You probably need an ajax call to update the 2 boxes when the value of your first box changes. See a sample here :http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-usi... On Nov 15, 10:29 pm,ldb[EMAIL PROTECTED] wrote: G'day I just can't seem to find the right answer to this one. Hopefully someone can point me in the right direction please. I have the following function in a app/controllers/models_controller.php. I load three select boxes two of which rely on data from the first one. I can enter a manual value into the array as you can see, and they display the data fine, but I can't seem to figure out how to capture the value of the current selected item from the first generateList to feed it to the two others. Can someone please enlighten me?.;-) function index() { $this-set('models', $this-Modelinfo-Model-generateList(null, 'Model_Number', null, '{n}.Model.Model_Number','{n}.Model.Model_Number', true, true ) ); $this-set('modelinfos', $this-Modelinfo-generateList(array('Modelinfo.Model_Number'= 'LD400'),null, null, '{n}.Modelinfo.Model_Number','{n}.Modelinfo.AltModel_Number')); $this-set('altmodels', $this-Altmodel-generateList(array('Altmodel.Model_Number'= 'LD400'),null, null, '{n}.Altmodel.Model_Number','{n}.Altmodel.Alt_Model')); } Thanks -- ldb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: using one select box to generate the results for two more
You probably need an ajax call to update the 2 boxes when the value of your first box changes. See a sample here : http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/ On Nov 15, 10:29 pm, ldb [EMAIL PROTECTED] wrote: G'day I just can't seem to find the right answer to this one. Hopefully someone can point me in the right direction please. I have the following function in a app/controllers/models_controller.php. I load three select boxes two of which rely on data from the first one. I can enter a manual value into the array as you can see, and they display the data fine, but I can't seem to figure out how to capture the value of the current selected item from the first generateList to feed it to the two others. Can someone please enlighten me?.;-) function index() { $this-set('models', $this-Modelinfo-Model-generateList(null, 'Model_Number', null, '{n}.Model.Model_Number','{n}.Model.Model_Number', true, true ) ); $this-set('modelinfos', $this-Modelinfo-generateList(array('Modelinfo.Model_Number'= 'LD400'),null, null, '{n}.Modelinfo.Model_Number','{n}.Modelinfo.AltModel_Number')); $this-set('altmodels', $this-Altmodel-generateList(array('Altmodel.Model_Number'= 'LD400'),null, null, '{n}.Altmodel.Model_Number','{n}.Altmodel.Alt_Model')); } Thanks -- ldb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: using one select box to generate the results for two more
G'day Thanks. I have already applied the setup from devmoz, it was very helpful and I have the example working and another copy where the two tables involved actually can use a belongs to just as an extra test. I have likely not explained this fully, sorry. I have a table with model numbers other info on the products called models, then I have a table which only contains three columns, ID, Model Number and Other Model Number called Altmodels, so that items that are comparable could be looked up and interchanged. The ID number is an autoincrement, Model Number and Other Model Number can occur several times in all possible combinations. Any reference to the codes would point back to the Models table, it's really just a kind of index. I could not determine a fit with the associations ( I could be missing something there) so I set up the generateList to accommodate this and realized that upon load, how do I tell the lower two lines the model code selected by default? Or can I. Maybe I am on the wrong track with that part and don't need those lines? I am using scriptaculous and have verfied that it is working within this cake project. I have done PHP b ut just started with Cake, I figure I'm abusing it but not sure how. On Nov 16, 1:44 am, francky06l [EMAIL PROTECTED] wrote: You probably need an ajax call to update the 2 boxes when the value of your first box changes. See a sample here :http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-usi... On Nov 15, 10:29 pm,ldb[EMAIL PROTECTED] wrote: G'day I just can't seem to find the right answer to this one. Hopefully someone can point me in the right direction please. I have the following function in a app/controllers/models_controller.php. I load three select boxes two of which rely on data from the first one. I can enter a manual value into the array as you can see, and they display the data fine, but I can't seem to figure out how to capture the value of the current selected item from the first generateList to feed it to the two others. Can someone please enlighten me?.;-) function index() { $this-set('models', $this-Modelinfo-Model-generateList(null, 'Model_Number', null, '{n}.Model.Model_Number','{n}.Model.Model_Number', true, true ) ); $this-set('modelinfos', $this-Modelinfo-generateList(array('Modelinfo.Model_Number'= 'LD400'),null, null, '{n}.Modelinfo.Model_Number','{n}.Modelinfo.AltModel_Number')); $this-set('altmodels', $this-Altmodel-generateList(array('Altmodel.Model_Number'= 'LD400'),null, null, '{n}.Altmodel.Model_Number','{n}.Altmodel.Alt_Model')); } Thanks -- ldb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: using one select box to generate the results for two more
G'day Ah, should have mentioned, I can restructure the table if that is needed, was trying not to. Been through too much trying to figure this one out, restructure would have to be less trouble if it makes Cake happier and works better within it's format. Thanks...;-) On Nov 16, 8:04 am, ldb [EMAIL PROTECTED] wrote: G'day Thanks. I have already applied the setup from devmoz, it was very helpful and I have the example working and another copy where the two tables involved actually can use a belongs to just as an extra test. I have likely not explained this fully, sorry. I have a table with model numbers other info on the products called models, then I have a table which only contains three columns, ID, Model Number and Other Model Number called Altmodels, so that items that are comparable could be looked up and interchanged. The ID number is an autoincrement, Model Number and Other Model Number can occur several times in all possible combinations. Any reference to the codes would point back to the Models table, it's really just a kind of index. I could not determine a fit with the associations ( I could be missing something there) so I set up the generateList to accommodate this and realized that upon load, how do I tell the lower two lines the model code selected by default? Or can I. Maybe I am on the wrong track with that part and don't need those lines? I am using scriptaculous and have verfied that it is working within this cake project. I have done PHP b ut just started with Cake, I figure I'm abusing it but not sure how. On Nov 16, 1:44 am, francky06l [EMAIL PROTECTED] wrote: You probably need an ajax call to update the 2 boxes when the value of your first box changes. See a sample here :http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-usi... On Nov 15, 10:29 pm,ldb[EMAIL PROTECTED] wrote: G'day I just can't seem to find the right answer to this one. Hopefully someone can point me in the right direction please. I have the following function in a app/controllers/models_controller.php. I load three select boxes two of which rely on data from the first one. I can enter a manual value into the array as you can see, and they display the data fine, but I can't seem to figure out how to capture the value of the current selected item from the first generateList to feed it to the two others. Can someone please enlighten me?.;-) function index() { $this-set('models', $this-Modelinfo-Model-generateList(null, 'Model_Number', null, '{n}.Model.Model_Number','{n}.Model.Model_Number', true, true ) ); $this-set('modelinfos', $this-Modelinfo-generateList(array('Modelinfo.Model_Number'= 'LD400'),null, null, '{n}.Modelinfo.Model_Number','{n}.Modelinfo.AltModel_Number')); $this-set('altmodels', $this-Altmodel-generateList(array('Altmodel.Model_Number'= 'LD400'),null, null, '{n}.Altmodel.Model_Number','{n}.Altmodel.Alt_Model')); } Thanks -- ldb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
RE: using one select box to generate the results for two more
G'day I just can't seem to find the right answer to this one. Hopefully someone can point me in the right direction please. I have the following function in a app/controllers/models_controller.php. I load three select boxes two of which rely on data from the first one. I can enter a manual value into the array as you can see, and they display the data fine, but I can't seem to figure out how to capture the value of the current selected item from the first generateList to feed it to the two others. Can someone please enlighten me?.;-) function index() { $this-set('models', $this-Modelinfo-Model- generateList(null, 'Model_Number', null, '{n}.Model.Model_Number','{n}.Model.Model_Number', true, true ) ); $this-set('modelinfos', $this-Modelinfo- generateList(array('Modelinfo.Model_Number'= 'LD400'),null, null, '{n}.Modelinfo.Model_Number','{n}.Modelinfo.AltModel_Number')); $this-set('altmodels', $this-Altmodel- generateList(array('Altmodel.Model_Number'= 'LD400'),null, null, '{n}.Altmodel.Model_Number','{n}.Altmodel.Alt_Model')); } Thanks -- ldb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---