----- "Marius Dumitru Florea" <mariusdumitru.florea(a)xwiki.com> wrote:
On Thu, Sep 29, 2011 at 9:19 PM, Scott Serr
<serrs(a)theserrs.net>
wrote:
I ran into an interesting side effect of having a form in my Class
Sheet.
<input type="hidden" name="parent"
value="${doc.fullName}" />
The above line is in a form which posts to the current page, but
then redirects to
a sub-page. The process is exactly like the FAQ
Example. The trouble is, when doing Inline Editing on a page with the
class object. No matter what you put in as the parent in the UI for
the parent property, it gets reset to itself on save. The wiki and
WYSYWIG editors don't do this of course.
I think this is a problem because...
1. Should this form (and form element) really be
evaluated? No one
hit the submit button.
How did you save without hitting the submit button? (You said "it
gets
reset to itself on save").
2. It doesn't seem very safe for variable
spaces to mix so easily.
Unless this is a feature.
"Inline form" edit mode is used to edit object properties. If you use
$doc.display method to generate your form fields then you'll see that
the field IDs/names look like this:
ClassName_objectIndex_propertyName
, so they don't interfere with the rest of the (hidden) fields like
"parent" which is used to set the document title. If you generate the
form fields yourself then indeed you have to take care to use unique
IDs/names to prevent conflicts.
Hope this helps,
Marius
Thanks for the reply.
My page has a form like {{{html}}}<form></form>{{{/html}}} if you look at the
wiki code. I'll call this the "embedded form." So when the page is viewed,
then the embedded form is available. An aside, the embedded form creates sub-pages. The
page also has an object and I'm fine with editing those properties in the inline form
editor. And, of course the embedded form on my page is not displayed because the inline
editor only shows and edits the object. My trouble comes here, when I save that object in
the inline editor, I get the embedded form's hidden post variables evaluated. I did
not click my embedded form's submit, I clicked the inline editor's save. It
behaves as if I clicked the embedded form's submit just before the inline editor's
save.
I know it sounds crazy. I'll try to isolate it to a minimal test case.