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

