Re: Questions regarding editing data in forms

2014-01-06 Thread Stephen S
Hey RoadRunner I'm not sure I would use named parameters to update records like that, I understand your concern and I think I would share the same concerns. It sounds like you want to be able to edit multiple records in place without having to view each individual record in a edit page, and go th

Questions regarding editing data in forms

2014-01-06 Thread RoadRunner
Hi, i'm new to CakePHP and try to build my first database application. So far i can list all customers in my test-database and view/edit a customer via a link with the customer id passed as a named parameter. At the moment i have 2 links to different controllers in each row of the customer lis

Re: Editing data

2011-09-17 Thread Mohd Hasnol
Thanks ecsyle. its work!! On Sat, Sep 17, 2011 at 4:37 AM, ecsyle wrote: > You need the id of A in your data set: > > echo $this->Form->input('A.id'); > > On Sep 16, 10:48 am, Mohd Hasnol wrote: > > Hi, > > > > If i use saveAll, it will add another A data. What happen? Thanks. > > > > > > > > >

Re: Editing data

2011-09-16 Thread ecsyle
You need the id of A in your data set: echo $this->Form->input('A.id'); On Sep 16, 10:48 am, Mohd Hasnol wrote: > Hi, > > If i use saveAll, it will add another A data. What happen? Thanks. > > > > > > > > On Thu, Sep 15, 2011 at 4:54 PM, WebbedIT wrote: > > As #2will advised, your problem is: >

Re: Editing data

2011-09-16 Thread Mohd Hasnol
Hi, If i use saveAll, it will add another A data. What happen? Thanks. On Thu, Sep 15, 2011 at 4:54 PM, WebbedIT wrote: > As #2will advised, your problem is: > $this->B->save($this->data) > > Should be: > $this->B->saveAll($this->data) > > > http://book.cakephp.org/view/1032/Saving-Related-Mode

Re: Editing data

2011-09-15 Thread WebbedIT
As #2will advised, your problem is: $this->B->save($this->data) Should be: $this->B->saveAll($this->data) http://book.cakephp.org/view/1032/Saving-Related-Model-Data-hasOne-hasMany-belongsTo HTH, Paul @phpMagpie On Sep 15, 2:59 am, Mohd Hasnol wrote: > edit.ctp > > Form->create('B', array('act

Re: Editing data

2011-09-14 Thread Mohd Hasnol
edit.ctp Form->create('B', array('action'=>'edit'));?> Form->input('A.first_name'); echo $this->Form->input('A.last_name'); echo $this->Form->input('A.contact_no'); echo $this->Form->input('A.email'); echo $this-

Re: Editing data

2011-09-14 Thread #2Will
Are you doing a saveAll rather than save in your controller? On Sep 14, 7:27 pm, Mohd Hasnol wrote: > inside edit.ctp > > Form->create('Useradmin', array('action'=>'edit'));?> >                     echo $this->Form->input('A.first_name'); >                     echo $this->Form->input('A.last_nam

Re: Editing data

2011-09-14 Thread Mohd Hasnol
inside edit.ctp Form->create('Useradmin', array('action'=>'edit'));?> Form->input('A.first_name'); echo $this->Form->input('A.last_name'); echo $this->Form->input('A.contact_no'); echo $this->Form->input('A.email'); ec

Re: Editing data

2011-09-14 Thread euromark
a less abstract code example would help you code post your "real" code. maybe this way we can figure out whats wrong with your code. On 14 Sep., 05:35, nOLL wrote: > Hi, > > I have a form that use 2 models(A,B). For create and view function it > was run perfectly, but there is a problem when edi

Editing data

2011-09-13 Thread nOLL
Hi, I have a form that use 2 models(A,B). For create and view function it was run perfectly, but there is a problem when editing the form. I use B controller for all the function(CRUD) and i only can edit the B table attributes but for A attributes the data remain the same. I follow this http://b

Editing data in related tables (hasOne)

2009-09-29 Thread Bunnie
Hi guys, I'm trying to edit data in related tables (Material hasOne Book). But by the time to save the data in the table are well edited, but the system tries to save a new record in paper, instead of edit. See code below: BensController

Re: editing data does not work either way

2009-03-22 Thread misterjinx
thanks for your reply. finally i figured it out. for every entry of the $this->data array i had to supply the id for rows each that should be updated (i had to insert hidden fields in the form). those who don't have ids are inserted. that solved my problem, now it's working like a charm :). thanks

Re: editing data does not work either way

2009-03-22 Thread gimmebucks
you should reassign the $key value before calling $this->Model->save. otherwise will assume that you are inserting new row. hope that'll help On Mar 23, 1:22 am, misterjinx wrote: > It's me again. I put validation to false in the saveAll() method, and > it's half working right now. The main tabl

Re: editing data does not work either way

2009-03-22 Thread misterjinx
It's me again. I put validation to false in the saveAll() method, and it's half working right now. The main table it's updated instead of inserting a new row, but others are not. It keeps inserting new records instead of updating those who already exists and inserting new ones just where's the cas

editing data does not work either way

2009-03-22 Thread misterjinx
Hello all, I've been trying all day long to figure it out an edit action of one of my controllers, but it just doesn't work. I have a model Contact which has many Email and Phonenumber. I've created the view, populated with data from the tables, and proceeded to the edit action. And here comes th