Hi, On Wed, Jan 11, 2017 at 7:04 PM, Stephen Martin <[email protected]> wrote:
> In developing an in house app using XWiki I am having difficulty getting a > page to display with more than one object. > > Currently using XWiki Enterprise 7.4.4. > > For testing purposes I have 2 classes: SetupHY32 and SetupUniqueValues. > I create a new page located in Sandbox called ObjGroupTest. > Selecting Object Editor I add the 2 classes and fill in data in each > property for each class. > When I save and view, only the first object is displayed. >From what you describe, you seem to be using a class sheet on the class of the first object you are adding to your test page. How did you create that class sheet, manually or using AWM? In view mode, you will either see the actual content of your document OR the content of a display sheet that is used to display your content. The mechanism for resolving which sheet to apply when displaying a content is described at http://extensions.xwiki.org/xwiki/bin/view/Extension/Sheet+Module#HSheetresolutionalgorithm but the idea is that, if you end up displaying the current document with the class sheet of one of the objects of the current document, it will stop there (resolves to 1 particular sheet, not to many). You seem to be expecting to have multiple sheets to be used when displaying a document, but this is not the way the Sheet mechanism is supposed to work. A document can *store* how many objects you want it to. *Displaying* the stored objects is up to you (the developer). Perhaps having a look over this application development tutorial might help you understand how classes/objects/sheets work together in building an application http://platform.xwiki.org/xwiki/bin/view/DevGuide/FAQTutorialManual Once you understand that, it should be clear that an object only really exists in the "object editor mode" (where you edit and store it) and that anything related to displaying is done through sheets or the document content and with code that says exactly which object(s) and which properties you want to display to the user. Another nice resource for understanding XWiki's API, velocity scripting and working with documents, objects, classes, etc. is http://platform.xwiki.org/xwiki/bin/view/DevGuide/XWikiVelocityTraining Hope this helps, Eduard > When I go back to edit the objects, all the data is there. > The fully qualified name for each object is > Sandbox.SetupHY32.Code.SetupHY32Class > (1) and Sandbox.SetupUniqueValues.Code.SetupUniqueValuesClass (1). > > According to XWiki data model page each page can have multiple objects. > > So the ultimate question is, how can more than one object be displayed on > a page? > > Thanks, > Steve > >

