Hi all,
I'd like to create a forms using XWiki and that my data may be stored into the
database.
Thus I try to create a XWiki Class.
First to test a small example, I just create a Class with the Class Editor
(XWiki/XWikiClasses). I've named my class Main.EssaiClass.
I keep the default configuration.
I added 2 string attributes to the class named "a" and "b".
XWiki.EssaiClass contains the following code :
#set( $class = $doc.name.substring(0,$doc.name.indexOf("Class")))
#set($defaultparent = "XWiki.${class}Class")
#set($defaultweb = "Main")
#includeForm("XWiki.ClassSheet")
XWiki.EssaiClassSheet :
1 Document $doc.name
## Change class name to your class name
#set($class = $doc.getObject("XWiki.EssaiClass").xWikiClass)
<table border="1" cellspacing="0" cellpadding="2">
#foreach($prop in $class.properties)
<tr><td> *${prop.prettyName}* </td>
<td>$doc.display($prop.getName())</td>
</tr>
#end
</table>
XWiki.EssaiClassTemplate :
#includeForm("XWiki.EssaiClassSheet")
Now I can see my class in the ClassEditor. However If Y create a new document
such as Main.TestDoc I can just see the title of the document. No form is
displayed :-(
Did I something wrong ?
Regards
--
Xavier MOGHRABI - Consortium ObjectWeb
Email: xavier.moghrabi at
objectweb.org
Phone: +33 4 76 61 52 35 - Skype ID: xavier.moghrabi.bureau