I try to create a new object of a class, but the form does not show up.
$doc.display("title", "edit", $obj) does not bring me an input field.
When investigating, it seems like following call returns a null-object.
#set($obj = $doc.getObject("XWiki.ArticleClass",0))
Anybody with xwiki experience that can explain?
My XWiki Version is 0.9.840
My code to add is from the default xwiki-base and look like this:
1.1 Add a News
#includeTopic("XWiki.XWikiCommonJavascript")
<form action="" id="newdoc">
<input type="hidden" name="parent" value="Main.WebHome"
/>
<input type="hidden" name="template"
value="XWiki.ArticleClassTemplate" />
<input type="hidden" name="sheet" value="1" />
<input type="hidden" name="webname" value="Main"/>
<input type="hidden" name="name" value=""/>
<input type="text" name="title" value="page name"
size="18"/>
<input type="button" value="Add this news" onclick='if
(updateName(this.form.title,this.form.name)) { action="../../inline/" +
this.form.webname.value + "/" + this.form.name.value; this.form.submit(); }'
/>
</form>
My template looks like this:
#includeForm("XWiki.ArticleClassSheet")
And the ClassSheet start like this:
#set($obj = $doc.getObject("XWiki.ArticleClass",0))
#if($context.action!="inline")
.....
#else
<table border="0">
<tr>
<td>
Title:
</td>
<td>
$doc.display("title", "edit", $obj)
......