Hi Roxana,
RoxanaM wrote:
Hi!
I'm new to xwiki and I want to create a page that has a text box and a
button that when I press it i want to display under the button the text
introduced in the text box.
How can I do this using groovy?
Why do you want groovy for that?
you want it to happen 1) asynchronous or 2) you want the page to reload and show
your text?
in XWiki documents in syntax 1.0 (which is active by default in latest stable
1.8.4), you can write html and scripting languages (groovy, velocity) directly
in your wiki documents (edit -> wiki).
So for 1) just edit a document, type your html (and javascript), save and view.
For more advanced things in javascript, you should use a JSX extension.
For 2) edit a document, type your html (a form submitting an input value to the
current page) and then type a little groovy below:
<%
println request.inputName;
%>
should do it!
Note that you could do the same in velocity too.
Happy hacking,
Anca Luca
Thanks!!