Hi I have a newbee question. I have made a form in a DTMLMethod which i'm going to use, to change some properties in an object. I'm calling it with: http://site/theObjectToChange/theMethod - and that part is working fine. When I have changed the values, how can I "save" those changes to the object. Regards Jens Bjerre
Jens JB. Bjerre wrote:
Hi
I have a newbee question. I have made a form in a DTMLMethod which i’m going to use, to change some properties in an object. I’m calling it with: http://site/theObjectToChange/theMethod - and that part is working fine. When I have changed the values, how can I “save” those changes to the object.
Regards
Jens Bjerre
manage_changeProperties is your friend... I think ;) \Oliver -- Direktør / Managing Director Oliver Marx TEKK Lyngbyvej 20 DK-2100 København Ø Main: +45 39 15 80 60 Direct: +45 39 15 80 62 http://www.tekk.dk
see: http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/ScriptingZope.st... section "Change properties of an object" hth, peter. Jens JB. Bjerre wrote:
Hi
I have a newbee question. I have made a form in a DTMLMethod which i’m going to use, to change some properties in an object. I’m calling it with: http://site/theObjectToChange/theMethod - and that part is working fine. When I have changed the values, how can I “save” those changes to the object.
Regards
Jens Bjerre
I have a newbee question. I have made a form in a DTMLMethod which i’m going to use, to change some properties in an object. I’m calling it with: http://site/theObjectToChange/theMethod - and that part is working fine. When I have changed the values, how can I “save” those changes to the object.
In Zope if you change an attribute or property, it stays changed. (That's the whole deal behind persistence.) What you may be thinking of is the passing of form data, which is available in the method to which you've passed that data. That's part of the REQUEST, which is a transient object. You can get at form data in the method that was just called, but in order to use it for other than immediate display, you'll have to do something with it in 'theMethod' . Probably you want manage_changeProperties(), from what I read, which will change the properties of the object it's being called on (in your case the container of 'theMethod') based on the name=value pairs in the REQUEST (which is a required parameter of that method) and any parameters passed to the method. Example: calling as http://server/container/method?title=moose a method containing <dtml-call "manage_changeProperties(REQUEST)"> I got the title = <dtml-var title> and set it. will set the 'title' property of 'container' to 'moose', as well as print that value. One can do this with either GET or POST actions. One can also do <dtml-call "manage_changeProperties(title='mooses')"> without needing the REQUEST object. You can do this with more than 'manage_changeProperties()': any method of any object could be used like this. --jcc
participants (4)
-
J Cameron Cooper -
Jens JB. Bjerre -
Oliver Marx -
Peter Sabaini