Re: [xwiki-users] Multiple 'classes', one form.. best practice?

2012-01-17 Thread Guillaume Lerouge
Hi Joris,

one approach would be to use one single class but to build the sheet by
hand and user javascript to display new fields based on the value of
filled-in fields.

Guillaume

On Tue, Jan 17, 2012 at 1:06 PM, Joris Dirks  wrote:

> Hi all,
>
> I am making a database where each page can have multiple 'levels' of
> data, each next level should be shown to the user only when a
> condition has been met, say:
> 1: general information
> - Question
> - Needs additional research: yes/no
> 2: additional research (only shown if applicable):
> - Researcher
> - Findings
>
> My initial idea was to use seperate classes and create a combined
> class sheet, like in the code below, but I suspect that will give
> difficulty for instance when creating overviews in a Livetable.
>
> Does anyone have experience in uses like this? Thanks for your ideas!
> Joris
>
>
> #set($class1 = $doc.getObject('Example.Class1').xWikiClass)
> #foreach($prop in $class1.properties)
>  ..
> #end
>
> if($class1.properties.needsadditionalresearch=="yes")
>  #set($class2 = $doc.getObject('Example.Class2').xWikiClass)
>  #foreach($prop in $class1.properties)
> ..
> ___
> 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


[xwiki-users] Multiple 'classes', one form.. best practice?

2012-01-17 Thread Joris Dirks
Hi all,

I am making a database where each page can have multiple 'levels' of
data, each next level should be shown to the user only when a
condition has been met, say:
1: general information
- Question
- Needs additional research: yes/no
2: additional research (only shown if applicable):
- Researcher
- Findings

My initial idea was to use seperate classes and create a combined
class sheet, like in the code below, but I suspect that will give
difficulty for instance when creating overviews in a Livetable.

Does anyone have experience in uses like this? Thanks for your ideas!
Joris


#set($class1 = $doc.getObject('Example.Class1').xWikiClass)
#foreach($prop in $class1.properties)
 ..
#end

if($class1.properties.needsadditionalresearch=="yes")
 #set($class2 = $doc.getObject('Example.Class2').xWikiClass)
  #foreach($prop in $class1.properties)
..
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users