Hi,
I tried to make a field (property) from an object available on another page and editable in-place.
That seems not possible but here are my attempts.
When I click on the edit button, the content is empty.
{{velocity}}
{{html wiki="true" clean="false"}}
## Load the JavaScript code required to make the object properties editable in-place.
#set ($discard = $xwiki.jsfx.use('uicomponents/edit/editableProperty.js', {
'forceSkinAction': true,
'language': $xcontext.locale
}))
#set($subdoc = $xwiki.getDocument('Test.another document'))
#set ($editing = $xcontext.action == 'edit')
#set ($xobject = $subdoc.getObject('Test.TestClass'))
#set ($xclass = $xobject.xWikiClass)
#set ($discard = $subdoc.use($xobject))
[[${subdoc.title}>>$subdoc]]
<div class="xform">
<dl>
#set($property=$xclass.get('my_field'))
<dt #if (!$editing && $hasEdit)
class="editableProperty"
#set ($xobjectPropertyReference = $xobject.getProperty($property.name).reference)
data-property="$escapetool.xml($services.model.serialize($xobjectPropertyReference))"
data-property-type="object"#end>
## This must match the id generated by the $doc.display() method below.
#set ($propertyId = "${xclass.name}_${xobject.number}_$property.name")
<label#if ($editing) for="$escapetool.xml($propertyId)"#end>
$escapetool.xml($property.translatedPrettyName)
</label>
## Support for specifying a translation key as hint in the property definition.
<span class="xHint">$!escapetool.xml($services.localization.render($property.hint))</span>
</dt>
<dd>$subdoc.display($property.name)</dd>
</dl>
</div>
{{/html}}
{{/velocity}}
Did I forget something?