To clarify: You want to change the value of a property in an object on
the page when saving the document and going directly back to view mode,
but not when canceling.
If the above is correct, then you want the property's new value to be
saved along with the rest of the document when saving. Since the save
action is the same from either mode (a form submission to the "save"
action), you need only place the appropriate input field in the form to
accomplish this.
How to set the value of the field depends on how the value is derived.
If the property's new value depends on the old one, the edit and inline
templates must contain code that gets the value and puts it into the
input field (See Document.display for the different ways to create the
field).
Of course, if the object doesn't exist before the editing, you must
create it first; see one of the class sheets for how that's done.
Finally, if the new value of the property can be known at render time
(i.e. when the edit or inline mode is entered), then you can use
Velocity script to modify the value before placing it in the field. If
it can't be known until the button is pushed, you must use Javascript to
create an "onclick" method for the form (or modify the existing one, or
add to the "onclick" attribute of the save buttons) that sets the new
value using the Javascript HTML DOM object representing the input field.
Someone else, likely a developer, will have to tell you how to
accomplish this in 1.0, because it uses a Javascript framework, and if
the previous value of the field has to be gotten fresh from the server,
you must use an AJAX method to get the value after pushing the button
and before submitting the form. Fortunately, I don't even know enough
about that to be dangerous.
brain[sic]
-----Original Message-----
From: Oova [mailto:ping.scan@gmail.com]
Sent: Friday, May 04, 2007 10:21 AM
To: xwiki-users(a)objectweb.org
Subject: [xwiki-users] detect finished action
I am looking for a way to detect using velocity code, whether
a button has been pressed. I want to change an object's
property's value before the action goes from edit or inline
back to view but only if the 'save and view'
button has been pressed.
thanks in advance
Uwe
--
View this message in context:
http://www.nabble.com/detect-finished-action-tf3692266.html#a10323349
Sent from the XWiki- Users mailing list archive at
Nabble.com.