You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Bill <bh...@collaborativefusion.com> on 2003/01/27 16:29:18 UTC

Re: problem using Intake group.setProperties(x);

Marc

Are you expecting the method group.setProperties( obj ) to actually save
the data?  Or are you saying that after you execute setProperties( obj )
and then obj.save() that the data isnt there?  AFAIK,
setProperties(Object obj) doesnt call obj.save().


On Mon, 2003-01-27 at 19:42, Marc Lustig wrote:
> Hi,
> I have two forms that correspond to the same Intake group.
> The first form is to create an object, the other one to edit it.
> Both forms are identical except that the edit-form calls
> $intake.MyGroup.mapTo($bo) in order to display the existing data in the
> form.
> 
> When I call the form that creates a new BO everything works fine.
> Now when I edit that BO group.setProperties(existingObject); won't save the
> data that was submitted. I have no explanation for this.
> 
> Is this a bug in Intake?
> Any work-around that is available?
> 
> Thanks.
> Marc
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


AW: AW: AW: problem using Intake group.setProperties(x);

Posted by Marc Lustig <ma...@marclustig.com>.
Thanks Bill a lot!
Only after changing the line to
Group group = intake.get("MyGroup", existingBo.getPrimaryKey().toString());
group.setProperties(x) worked.

I couldn't figure out this from the Intake howto.



> -----Ursprüngliche Nachricht-----
> Von: Bill [mailto:bhalpin@collaborativefusion.com]
> Gesendet: Dienstag, 28. Januar 2003 13:14
> An: Turbine Users List
> Betreff: Re: AW: AW: problem using Intake group.setProperties(x);
>
>
> Sorry to reply so late, I was not supposed to be in the office today...
>
> > Hmm... passing the primary key of the object instead of the default key?
> > I've never done this. So far I do it this way:
> > in intake.xml: <group name="MyGroup" key="someuniquetext">
> > in action-method:
> > Group group = intake.get("MyGroup","someuniquetext");
> >
> > Do you mean to pass the primary key of the existing bo as a String?
> > Like
> > Group group = intake.get("MyGroup", ""+bo.getPrimaryKey().intValue());
>
> > Is that what you mean?
> Yes, but I believe the key has to be passed as a String, at least
> it did in 2.1
>
> > Do I have to change the group definition in intake.xml?
>
> Not that I know of.  You only have to do it this way because you mapped
> the object to the group in your template.
> >
> > Greetings
> > Marc
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: AW: AW: problem using Intake group.setProperties(x);

Posted by Bill <bh...@collaborativefusion.com>.
Sorry to reply so late, I was not supposed to be in the office today...

> Hmm... passing the primary key of the object instead of the default key?
> I've never done this. So far I do it this way:
> in intake.xml: <group name="MyGroup" key="someuniquetext">
> in action-method:
> Group group = intake.get("MyGroup","someuniquetext");
> 
> Do you mean to pass the primary key of the existing bo as a String?
> Like
> Group group = intake.get("MyGroup", ""+bo.getPrimaryKey().intValue());

> Is that what you mean?
Yes, but I believe the key has to be passed as a String, at least it did in 2.1

> Do I have to change the group definition in intake.xml?

Not that I know of.  You only have to do it this way because you mapped
the object to the group in your template.  
> 
> Greetings
> Marc
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


AW: AW: problem using Intake group.setProperties(x);

Posted by Marc Lustig <ma...@marclustig.com>.

> -----Ursprüngliche Nachricht-----
> Von: Bill [mailto:bhalpin@collaborativefusion.com]
> Gesendet: Montag, 27. Januar 2003 18:32
> An: Turbine Users List
> Betreff: Re: AW: problem using Intake group.setProperties(x);
>
>
> Marc
>
> Now that you've replied, I dont know if I understood the problem you are
> having.  What I think you were saying is that you create a 'bo' in the

With bo I refer to business object.

> first form.  The second form is for editing the information.  The second
> form's template maps the intake group to the object 'bo' which it has
> used to populate the form with the current values from the database.
> When you edit the form and submit the changes the database does not
> reflect these changes.
>
> Now my understanding of what you have in your action class is something
> like this:
>
> Object bo = BoPeer.retrieveByPK(key);
>
> Group boGroup = intake.get("BO", key);// Cant use default key here
>
> boGroup.setProperties(bo);

yes, right, and the problem is here: boGroup.setProperties(bo);
does not set the values when applied to the form which was mapped to the
existing object from the db.

> The other thing I would check is the intake.get() statement and make
> sure you are passing the primary key of the object instead of the
> default key.  This needs to be verified on the template end as well.

Hmm... passing the primary key of the object instead of the default key?
I've never done this. So far I do it this way:
in intake.xml: <group name="MyGroup" key="someuniquetext">
in action-method:
Group group = intake.get("MyGroup","someuniquetext");

Do you mean to pass the primary key of the existing bo as a String?
Like
Group group = intake.get("MyGroup", ""+bo.getPrimaryKey().intValue());

Is that what you mean?

Do I have to change the group definition in intake.xml?

Greetings
Marc


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: AW: problem using Intake group.setProperties(x);

Posted by Bill <bh...@collaborativefusion.com>.
Marc

Now that you've replied, I dont know if I understood the problem you are
having.  What I think you were saying is that you create a 'bo' in the
first form.  The second form is for editing the information.  The second
form's template maps the intake group to the object 'bo' which it has
used to populate the form with the current values from the database. 
When you edit the form and submit the changes the database does not
reflect these changes.  

Now my understanding of what you have in your action class is something
like this:

Object bo = BoPeer.retrieveByPK(key);

Group boGroup = intake.get("BO", key);// Cant use default key here

boGroup.setProperties(bo);

So as I was saying unless you are saving ( bo.save(); ) then this data
will not be reflected in the database.  

The other thing I would check is the intake.get() statement and make
sure you are passing the primary key of the object instead of the
default key.  This needs to be verified on the template end as well.

-b


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


AW: problem using Intake group.setProperties(x);

Posted by Marc Lustig <ma...@marclustig.com>.
Bill, group.setProperties( obj ) is supposed to map the formdata to the
object obj. And that's what I'm trying.
Problem is intake just won't map it.




> -----Ursprüngliche Nachricht-----
> Von: Bill [mailto:bhalpin@collaborativefusion.com]
> Gesendet: Montag, 27. Januar 2003 16:29
> An: Turbine Users List
> Betreff: Re: problem using Intake group.setProperties(x);
>
>
> Marc
>
> Are you expecting the method group.setProperties( obj ) to actually save
> the data?  Or are you saying that after you execute setProperties( obj )
> and then obj.save() that the data isnt there?  AFAIK,
> setProperties(Object obj) doesnt call obj.save().
>
>
> On Mon, 2003-01-27 at 19:42, Marc Lustig wrote:
> > Hi,
> > I have two forms that correspond to the same Intake group.
> > The first form is to create an object, the other one to edit it.
> > Both forms are identical except that the edit-form calls
> > $intake.MyGroup.mapTo($bo) in order to display the existing data in the
> > form.
> >
> > When I call the form that creates a new BO everything works fine.
> > Now when I edit that BO group.setProperties(existingObject);
> won't save the
> > data that was submitted. I have no explanation for this.
> >
> > Is this a bug in Intake?
> > Any work-around that is available?
> >
> > Thanks.
> > Marc
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>