Hello,

Bubulina wrote:
> Hello Sergiu,
> 
> it was a typo when i wrote by hand the code here.
> I include the TestClass, that has the properties, but the line that should
> give me the object from it:
> #set($object = $document.getObject("spaceName.TestClass").xWikiClass)
> returns nothing...
> 

You don't need the .xWikiClass. Try just:
#set($object = $document.getObject("spaceName.TestClass")

-Joshua

> 
> Sergiu Dumitriu-2 wrote:
>> On 12/16/2009 02:08 PM, Bubulina wrote:
>>> Hello
>>>
>>> 1. i create a class and add n properties. besides the properties added i
>>> have this code:
>>> #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class")))
>>> #set($defaultparent = "XWiki.${class}Class")
>>> #set($defaultweb = "Test")
>>> #includeForm("XWiki.ClassSheet")
>>>
>>> 2. i create doc where i include the class:
>>> #includeForm("$space.TestClass")
>>> because I wanna get those prop:
>>>
>>> #includeForm("$space.TestClass")
>>> #set($object = $doc.getObject("$space.TestCkass").xWikiClass)
>> $space.TestCkass is wrong, not just because it's Ckass instead of Class, 
>> but because the dot is part of the Velocity syntax. So $space.TestClass 
>> is not expanded as ($space).TestClass, but as $space.get("TestClass"), 
>> which is the value of the "TestClass" property of that object. Try 
>> ${space}.TestClass. Even better, you know where the class is, you could 
>> just use 'Test.TestClass'.
>>
>>> object - $object
>>>   #foreach($prop in $object.properties)
>>>   -- ${prop.prettyName}</dt>
>>>     : $doc.display($prop.getName())</dd>
>>> #end
>>>
>>> and my $object shows nothing. probably my favourite question....what am i
>>> missing here?
>>> Thanks
>> -- 
>> Sergiu Dumitriu
>> http://purl.org/net/sergiu/
>> _______________________________________________
>> users mailing list
>> users@xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/users
>>
>>
> 
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to