Try a Tapestry AJAX Form with two Submits: one visible and one hidden. Add JavaScript that listens to the click of the visible submit, stops the event propagating, does the call to the external service and, on success, sets the value of the form field (which might be a hidden field) and clicks the hidden submit.
Here's a standard AJAX Form: T5.4: http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/form T5.3: http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/form Here's some JavaScript that listens to something: T5.4: http://jumpstart.doublenegative.com.au/jumpstart7/examples/javascript/robust T5.3: http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/robust Geoff On 23 Jul 2014, at 2:38 am, Shahid Shaikh <sshaikh1...@yahoo.com.INVALID> wrote: > Fellow Tapestry Users, > > I have a form that when submitted needs to > make a call to an external service (calling a URL that will return a > value of type string) which i will then add to the form data and do the > actual submit. > What is the best way to handle this in Tapestry? > > So for e.g > > @Log > Object onSubmitFromTestForm() { > > //need to make some form of AJAX or javascript call here to the URL provided > //that will return a value > > String key = $.ajax... //not sure how to call the URL in tapestry that will > get me the value > > .. continue with regular process with key obtained and do the submit > > return ConfirmedPage.class; > } > > Thanks for your help! --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org