Create a sheet for two objects, where objects are on different pages

Hi

We have two objects of two different Classes, each on it’s own page.

We looked, for a example,
http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide#HAccessobjectsinapage

## get the document which has the object (only one here) - this is the page where I can see things in the object editor
## Retrieve the first object (index [0]) among all objects attached to the page MySpace.MyDocWithMyClassObjects and of a certain class MySpace.MyClass
#set( $MyDoc = $xwiki.getDocument("MySpace.MyDocWithMyClassObjects"))
## get the document wich contains the class definition: this page has entries in the class editor
#set( $class = $xwiki.getClass("MySpace.MyClass"))
#foreach($prop in $class.properties) ## go through all properties
  * ${prop.prettyName} : $MyDoc.display($prop.getName())
#end

our implementation is a bit different as we have two objects to manage:

## first the object on this page ($doc)
#set($class = $doc.getObject('Sandbox.testClassOOPage1').xWikiClass)
#foreach($prop in $class.properties)
  ; $prop.prettyName
  : $doc.display($prop.getName())
#end

## then the object (of a different class) on another page
#set($docClass2 = $xwiki.getDocument('Sandbox.testClassOOPage2Example') )
$docClass2
#set($objectOfClass2 = $docClass2.getObject('Sandbox.testClassOOPage2').xWikiClass)

#foreach($class2Prop in $objectOfClass2.properties)
  ; $class2Prop.prettyName
  : $docClass2.display($class2Prop.getName())
#end

This works fine in view mode…
But the problem is that we also need EDIT mode (inline)

The form seems ok before saving , we have input controls for both objects (of different classes). We also see the data of both objects
But when I modify the data of the second object in the form and press SAVE & VIEW the modification is not saved…

How can we achieve our goal

You have this issue when you create a new page or also when you edit a page which already have those two objects ?

This is the kind of behavior you would have if the template you use when you create your page only contain one object but it’s not very clear from your message what is you context so I would need more details.