Hi Mike, Mike Davis wrote:
I have javascript code that will get user input from a simple input form, but I need to use that input to query some groovy objects. If I understand correctly, groovy code is parsed on the server, then the javascript is parsed on the user's machine, so I can't pass javascript variables to the groovy code. Is there a way to reload the page such that I could pass the input values to groovy?
Any solution where the user inputs a string to be used in a groovy query is welcome as well.
The easiest way is to use a form that submits to the same page: ----------8<---------- {{velocity}} #if("$!request.myInput" == "") No value was submitted. #else Submitted value: $request.myInput #end {{html}} <form action=""> <div> <label for="myInput">My Input:</label> <input type="text" id="myInput" name="myInput" value="$!request.myInput" /> <input type="submit" value="Submit" /> </div> </form> {{/html}} {{/velocity}} ---------->8---------- This example is with Velocity, but Velocity is parsed as Groovy on the sever side. I don't know that well groovy, but I'm sure you can do something similar. Hope this helps, Marius
Thanks,
-Mike
_________________________________________________________________ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:W... _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users