On Wed, Dec 9, 2015 at 4:01 PM, Giordano Ninonà <[email protected]> wrote:
> Dear Marius, > > Many thanks for your reply, but I can't understand where to put the button, > how to create it and in general how to develop what you suggested. Sorry > but I am very confused on how XWiki handle this and how HTML, JavaScript > and AJAX work in the XWiki environment. > Check http://www.xwiki.org/xwiki/bin/view/FAQ/How+can+I+create+a+new+page+based+on+a+form . Call your script service from Velocity when the form submit is handled (instead of creating a new page). Hope this helps, Marius > > Looking foreward for your reply, > Giordano Ninonà. > > > 2015-12-07 10:01 GMT+01:00 Marius Dumitru Florea < > [email protected]>: > > > On Thu, Dec 3, 2015 at 5:18 PM, Giordano Ninonà < > [email protected] > > > > > wrote: > > > > > Dear devs, > > > > > > I am wondering on how to add to a page a button that, when it is > clicked, > > > will start a Java component through a scripting service. I would also > the > > > space name to my component. > > > > > > It is possible to do that? > > > > > > > A button cannot start a Java component or call a script service because > the > > button is on the client side (in your browser) and both the Java > component > > and the script service are on the server side. What the button can do is: > > > > (1) Submit an HTML form (no JavaScript needed). The browser will make an > > HTTP request to the specified page passing some parameters. The > (Velocity) > > code on the requested page (where the form is submitted) will check the > > parameters and if they are present will call the script service and thus > > the Java component. > > > > or > > > > (2) Trigger a click event, which you can listen to using JavaScript and > > then make an AJAX request with some parameters. The (Velocity) code on > the > > requested page will do the same thing as with (1). > > > > Hope this helps, > > Marius > > > > > > > > > > Thanks, > > > Giordano. > > > _______________________________________________ > > > devs mailing list > > > [email protected] > > > http://lists.xwiki.org/mailman/listinfo/devs > > > > > _______________________________________________ > > devs mailing list > > [email protected] > > http://lists.xwiki.org/mailman/listinfo/devs > > > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs > _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

