Re: Some problem on the hasmany relationship

2011-04-28 Thread jackgoh
UpdateAll()... if i split to : $this->Stock->CategotyStock->save($this->data), i will get error message: Undefined index: StockCategory. Why? Thanks again. Regards. On Apr 28, 7:26 pm, jackgoh wrote: > ahh.. okay, let me try then. > > Thanks. > > Regards > > On Apr

Re: Some problem on the hasmany relationship

2011-04-28 Thread jackgoh
the 'last' record. > Would it work for you to switch the columns around? That would give you the > three values you need. > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 28 Apr 2011, at 11:13, jackgoh wro

Re: Some problem on the hasmany relationship

2011-04-28 Thread jackgoh
nd list? > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 28 Apr 2011, at 07:19, jackgoh wrote: > > > > > Hi Jeremy, > > > - There is a missing ' before category_id after > > 'associationForeign

Re: Some problem on the hasmany relationship

2011-04-27 Thread jackgoh
in the array, business_category_id is same as category_id in my example, i just changed it. Sorry. On Apr 28, 2:19 pm, jackgoh wrote: > Hi Jeremy, > > - There is a missing ' before category_id after > 'associationForeignKey' > => sorry, my typo in this content o

Re: Some problem on the hasmany relationship

2011-04-27 Thread jackgoh
When i tried to debug($this->data['BusinessCategory']); in the Edit View, i can get correct array which is 3 records in the array. On Apr 28, 2:19 pm, jackgoh wrote: > Hi Jeremy, > > - There is a missing ' before category_id after > 'associationForeignKey&#

Re: Some problem on the hasmany relationship

2011-04-27 Thread jackgoh
is a compelling reason not to. > - Do you have a model for StockCategory? > - What happens when you use find 'all' rather than 'list'? > - What happens when you die(debug($selectedRecord)) in your controller before > passing it to your view? > > Out of interest, wh

Re: Some problem on the hasmany relationship

2011-04-27 Thread jackgoh
bug to 2 to see it. > > > > On Mon, Apr 25, 2011 at 1:25 PM, jackgoh wrote: > > Hi, > > > I am facing some problem when deal with a realtionship tables, the > > record is not display : > > > // in Stock model: > >        var $h

Re: Some problem on the hasmany relationship

2011-04-26 Thread jackgoh
Hi, Nobody can help me out??? Regards On Apr 26, 1:25 am, jackgoh wrote: > Hi, > > I am facing some problem when deal with a realtionship tables, the > record is not display : > > // in Stock model: >         var $hasAndBelongsToMany = array( >            

Some problem on the hasmany relationship

2011-04-25 Thread jackgoh
Hi, I am facing some problem when deal with a realtionship tables, the record is not display : // in Stock model: var $hasAndBelongsToMany = array( 'Category' => array( 'className' => 'Category', 'joinTable' => 'category',

Re: Add/Edit not working when joined two tables using hasOne.

2011-04-20 Thread jackgoh
x27;text', 'label'=>false));?> Location:Form- >input('StockDetail.location', array('type'=>'text', 'label'=>false));? > Form->submit('Save', array('div&

Add/Edit not working when joined two tables using hasOne.

2011-04-19 Thread jackgoh
Hi, Model: // Stock model //== class Stock extends AppModel { var $name = 'Stocks'; var $belongsTo = array( 'Category' => array('className' => 'Category', 'conditions' => array('Category.id = category_id'),

Simple CRUD when involving two tables or above.

2011-04-19 Thread jackgoh
Hi, I try to use the following method to develop the CRUD when involve two tables or more: $this->Product- >unbindModel(array('hasOne'=>array('ProductDetail'))); $this->Product->bindModel(array('hasOne'=>array( 'ProductDetail'=>arra

Validation errors only working in Add form, but not in Edit form.

2011-04-18 Thread jackgoh
Hi, The validation message is working in Add Form, but not in the Edit Form, can anyone help me? Part of my code in the controller: function edit($id = null) { $this->Post->id = $id; $sectors = $this->Post->Sector->find('list', array(

Re: I want to use textbox to display datetime fileld instead of drodown lists.

2011-04-15 Thread jackgoh
gt; $model['saveDate'])); > OR > $this->Form->text('saveDate', array('value'=>$model['saveDate'])); > (the 'value' key in the options array will force that value to be in > the HTML element) > > For more details, reference

Re: I want to use textbox to display datetime fileld instead of drodown lists.

2011-04-14 Thread jackgoh
ook about the > callbacks:http://book.cakephp.org/view/1048/Callback-Methods > > On 14 Apr., 09:55, jackgoh wrote: > > > > > So, when i m on the Edit form,i have to use function afterFind() in my > > model ?- Hide quoted text - > > - Show quoted text - -- Our

Re: I want to use textbox to display datetime fileld instead of drodown lists.

2011-04-14 Thread jackgoh
So, when i m on the Edit form,i have to use function afterFind() in my model ? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscr

I want to use textbox to display datetime fileld instead of drodown lists.

2011-04-11 Thread jackgoh
Hi, When we use DateTime as data type, cakephp will auto generate dropdown lists, but i want it display in textbox. Because most of the time the date is only display in the textbox as ReadOnly, but it is editable when User role is Admin or specified. Another reason is i want to use datepicker, so

Re: cakephp multilingual + route

2011-04-05 Thread jackgoh
YES THIS IS THE SOLUTION that i want! Thank you Zaky. You really help me lot. Regards, Jason On Apr 5, 12:21 pm, Zaky Katalan-Ezra wrote: > http://stackoverflow.com/questions/1794412/adding-a-prefix-to-every-u... -- Our newest site for the community: CakePHP Video Tutorials http://tv.cak

cakephp multilingual + route

2011-04-04 Thread jackgoh
Hi, i have two languages to allow user to choose/switch: en or fr i want the url as: • xxx.com/en/ --> default language is en • xxx.com/en/stock/stockName1/ -> dynamic page in EN language, it is similar to xxx.com/stock.php?lang=en&stockid=123 • xxx.com/fr/stock/stockName1/ -> dynamic page i