Does this script produce an error ? Do you see a new page with a wrong
name in the what's new ?
Btw at first sight I'd try to protect velocity variables :
#set($space = $!request.space)
#set($text = $!request.text )
afisare textfield: $text
#set ($mydoc = $xwiki.getDocument("${space}.${text}"))
$mydoc.setContent("test")
$mydoc.save()
Some tests to avoid empty strings would be good to have too.
On Wed, May 14, 2008 at 4:11 PM, Gabriela Radu <nohinder(a)yahoo.com> wrote:
hello Vincent,
i found your link most usefull , but it's made static. when i tried to give the
parameters dinamically(the name of the space, and the text from a textfield) like
this...it does not let me :
#set($space = $request.space)
#set($text = $!request.text )
afisare textfield: $text
#set ($mydoc = $xwiki.getDocument("$space.$text"))
$mydoc.setContent("test")
$mydoc.save()
i know this question is kind of a long shoot to ask..but i have no ideea why can't it
work.
Vincent Massol <vincent(a)massol.net> wrote:
On May 14, 2008, at 1:49 PM, Vincent Massol wrote:
Hi,
On May 14, 2008, at 1:41 PM, Gabriela Radu wrote:
hello!
where can i find the code that creates a new xwiki page? i know i
can create new pages from xeclipse. but i wanna be able to create
the pages from an interface. for instance to have a text field and a
button, and when the button is pressed a new page will be created
with the name given in the text field.
thank you for your time
See
http://code.xwiki.org/xwiki/bin/view/Snippets/CreatePageSnippet
For HTML forms, see the FAQ or TODO tutorial for example.
Would be good if you update the
http://code.xwiki.org/xwiki/bin/view/Snippets/CreatePageSnippet
page when you find out how to use a form to create a new page for ex.
Another hint: check the Create Panel which does exactly this.
Thanks
-Vincent
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users