Hello,

I'm posting here because I tried to implement solution proposed by Sergiu
but it's not (yet) working ... (I'm using XWiki 1.5.2)

I want to have a "Database Tree List" property in a class of type FAQ
(FAQs.FAQClass). I would like to use this property to link together a FAQ
property "Category" with a "SubCategory", the subcategory being a db tree
list (and the category being ...I don't know ...)

So I first created a class "FAQs.FAQCategoryClass" with the class wizard,
with String properties "ID", "VALUE" and "PARENT"
Then, I created objects of this class as follows :
Obj1 (ID='CAT1', VALUE='CAT1', PARENT='')
Obj2 (ID='SUBCAT11', VALUE='SUBCAT11', PARENT='CAT1')
Obj3 (ID='SUBCAT12', VALUE='SUBCAT12', PARENT='CAT1')
Obj4 (ID='CAT2', VALUE='CAT2', PARENT='')
Obj5 (ID='SUBCAT21', VALUE='SUBCAT21', PARENT='CAT2')

Then I created only 1 property "Category", as a Database List type, and
parameterized : XWiki Class Name = 'FAQs.FAQCategoriesClass', ID Field Name
= 'ID', Value Field Name = 'VALUE'.
When creating an object from my FAQ class, I get in "Category" field
expected valued as a list : "CAT1", "SUBCAT11", "SUBCAT12", "CAT2",
SUBCAT21".
**** First question : what if I wanted to have only "CAT1" and "CAT2" in
this list, in order to first select a category, and then the dependent
subcategory ?

Then I created a "SubCategory" property, as a Database Tree List type, and
parameterized : XWiki Class Name = 'FAQs.FAQCategoriesClass', ID Field Name
= 'ID', Value Field Name = 'VALUE', Parent Field Name = 'PARENT'.
When creating an object from my FAQ class, I get a 
java.lang.StackOverflowError at
com.xpn.xwiki.objects.classes.ListClass.getDisplayValue (infinite calls to
addToSelect() ).
**** Second question : what am I doing wrong ?
**** Third question : maybe I don't even need the "Categories" field, and
the tree is displayed directly in the select field ? (Don't know because
could not make it succeed yet).

Thanks for help, and sorry for long message ... :/
Regards,
Jeremie

-- 
View this message in context: 
http://n2.nabble.com/Help-wanted-on-the-database-list-class-property%2C-database-tree-class-property-and-the-Custom-Display-attribute.-tp508135p1337150.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

Reply via email to