Abel Marrero Santos wrote:
> 
> I would like to build a @DirectLink which made the request in an
> asynchronous way but request the client with a javascript confirmation
> dialog before the AJAX request. I have tried [...]
> But it didn't work. Even if I click on "OK" or "Cancel" the AJAX action
> takes place.
> 

Couldn't you hide the link with "display: none" and render a dummy link that
calls the onclick handler?  Something like this...


<script>
  function confirmBox() {
    if (window.confirm('Está seguro que desea borrar
este medio?')) {
      document.getElementById('myComponentId').onclick();
    }
  }
</script>
<span onclick="confirmBox();">Fake link</span>
<a jwcid="@DirectLink" listener="listener:doDeleteMedium"
  parameters="ognl:medium.id"
  async="ognl:true"
  updateComponents="mediumList"
  id="myComponentId"
  style="display: none;">
  <span key="delete"/>
</a>

-- 
View this message in context: 
http://www.nabble.com/Tapestry-4.1----Asynchronous-request-with-confirm-tp13900850p14330920.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Reply via email to