On Fri, Dec 11, 2015 at 12:55 PM, gervwyk <gerv...@gmail.com> wrote: > Good day. > > I'm trying to add users to a users list within a object. After I have > instanciated the object on the document which I want to ammend, how do I > "set" and "get" the user list property in a java component? I have: > > BaseObject domainObject = doc.getXObject(referenceClass); > domainObj.set("lisfOfUsers", ??user?? , xcontext); > > domainObj is of a class where the "lisfOfUsers" is a List of Users property. > Currently I have the username as a string. I have tried creating a User or > XWikiUser object and setting the property with the object but with no > success.
This kind of property contains a List of user reference (the reference of the user profile), for example "XWiki.ThomasMortagne". What you can do in cases like this is to edit the object using the object editor UI and then look at what BAseObject#getValue('lisfOfUsers') gives you. > > > > -- > View this message in context: > http://xwiki.475771.n2.nabble.com/Adding-users-to-a-user-list-form-a-java-component-tp7597177.html > Sent from the XWiki- Users mailing list archive at Nabble.com. > _______________________________________________ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users -- Thomas Mortagne _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users