On Thu, Jan 29, 2015 at 1:05 PM, Pascal BASTIEN <[email protected]> wrote: > Hello,I have a docClass with some properties and use a linked Sheet to > display my data.On this thread > http://xwiki.475771.n2.nabble.com/Help-with-custom-display-td508630.htmlI saw > we can get this value in "custom display" field of docClass properties.- > $name = the name of the displayed field > - $prefix = a prefix for the form field > - $object = the displayed object > - $type = the intended display mode (view, edit, hidden, search...) > - $value = the property value > > I try to have same value from mydocSheet (in particulary prefix the id of the > field in edit form) > There Velocity code in my docSheet: > > #set($class = $doc.getObject('MySpace.docClass').xWikiClass) > > #foreach($prop in $class.properties) > * "$prop.Name" * $prop.?????? How to obtain the prefix ??? * $object (it > doesn't matter) * $xcontext.action * $doc.getValue($prop.Name) > $prop.prettyName $doc.display($prop.getName()) > #end > #break > If any have an (or many) idea how I can obtain this prefix in my Sheet
> (If not I can concanet MySpace.docClass_0_$prop.Name but I'm not sure about > _0_) I'm afraid you have to compute the prefix yourself. 0 represents the object number. So MySpace.MyClass_4_age refers to the 'age' property of the MySpace.MyClass object with number 4 (normally the fifth object of that type from the target document). Hope this helps, Marius > > Thxs > Pascal B > _______________________________________________ > users mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/users _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
