[xwiki-devs] Setting and saving Object properties
Hello, I would greatly appreciate a little clarification clarification on the following two points regarding objects. 1. In current wiki page if I access an object attached to a different page and then sets it's value, how do I save the property values programmatically? Apparently the new property values appear in the object view of the corresponding page but a database search does not show the new values unless I manually save the page (to which the object is attached). 2. In current wiki page I created a couple of objects and then set the property values. $doc.save saves the objects but seemingly has some interesting limitations. Number of property values it can save is limited. Say for example: if I have 12 properties and their values set, $doc.save works say, for example, after 6 of those property values are set. If I put $doc.save after one additional obj.set statement it gives error. I also found $doc.save to be dependent on string length of the property values. If string lengths are small it can save , for example, 13 properties. In such cases, again, manual save works fine (although I want to avoid that). A solution/workaround with a little code example will be greatly appreciated..... Thanks
Actually $doc.save() was behaving in a wierd way because one of the object property data types was integer and I was not setting it the right way. On Wed, Feb 4, 2009 at 6:56 PM, Vivian Richard <kanpsack@gmail.com> wrote:
Hello,
I would greatly appreciate a little clarification clarification on the following two points regarding objects.
1. In current wiki page if I access an object attached to a different page and then sets it's value, how do I save the property values programmatically? Apparently the new property values appear in the object view of the corresponding page but a database search does not show the new values unless I manually save the page (to which the object is attached).
2. In current wiki page I created a couple of objects and then set the property values. $doc.save saves the objects but seemingly has some interesting limitations. Number of property values it can save is limited. Say for example: if I have 12 properties and their values set, $doc.save works say, for example, after 6 of those property values are set. If I put $doc.save after one additional obj.set statement it gives error. I also found $doc.save to be dependent on string length of the property values. If string lengths are small it can save , for example, 13 properties. In such cases, again, manual save works fine (although I want to avoid that).
A solution/workaround with a little code example will be greatly appreciated.....
Thanks
participants (1)
-
Vivian Richard