Hello Ludovic,
On Sun, May 18, 2008 at 3:58 AM, Ludovic Dubost <[EMAIL PROTECTED]> wrote:
> Archana Mettu wrote:
> > Having retrieved an object on a page, how can I update some fields of
> that
> > object and save?
> > Doc.save() saves the document changing its version.... but, doesn't
> update
> > the object-parameters. What am I missing?
> >
> >
> You can use $doc.getObject(classname) to retrieve an object and
> manipulate it's properties.
>
I am trying to do exactly that, with a very silly code, and it doesn't work,
the value of the property doesn't change. Take a look at the code:
#set($obj = $doc.getObject("Space.MyClass"))
#set($obj.accessCounter = $obj.accessCounter + 1)
~~Number of accesses: $obj.accessCounter~~
The value displyed remains the one I defined by editing the object with the
object editor, what suggests the second set is not doing what I expected.
Do you have any idea of what am I doing wrong?
Thanks,
--
Tiago Rinck Caveden
http://caveden.multiply.com
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs