probelm with script inside ok function in a a dialog

probelm with script inside ok function in a a dialog

I have a submit button with onclick script which  works now I wanted to show jquery dialog  and on click Ok execute the button script

here is the button 

  1. <input style="margin-top: 1em;" type="submit" value="ADL" class="submitbutton ui-button ui-widget ui-state-default ui-corner-all" wicket:id="adl" name="noFindingGroupsBtnsContainer:adl" id="adl2b3" onclick="var wcall=wicketSubmitFormById('reviewForm2b0', '?x=Dey9PT2gy1YuenfaMGBagUANwBRKlaVd5huPWU-oPNBYUDs*nz1v8hztWlx3FiLFwcq1iD0dcAtS0IBc-6h9fgMeoyFtWfNxH**95XJRikj9MY-Lk6b*ifDHBe9eO93BddF814Ut612AETOd4t7ing', 'noFindingGroupsBtnsContainer:adl' ,function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$$(this)&amp;&amp;Wicket.$$('reviewForm2b0')}.bind(this));;; return false;" role="button" aria-disabled="false">
I changed this to so that dialog appears on on click Ok execute dfunction for button


  1. <input type="submit" class="smallbutton ui-button ui-widget ui-state-default ui-corner-all" wicket:id="delete" value="Delete" name="delete" id="delete2cd" onclick="
  2. $('body').append('&lt;div id='+'confirm-dialog'+'&gt;&lt;span&gt;Are you sure you want to delete?&lt;/span&gt;&lt;div/&gt;');
  3.     $('#confirm-dialog').dialog({
  4. modal: true,
  5. autoResize:true,  
  6. title: 'Please confirm!',
  7. buttons: {
  8. OK: function() {
  9. $(this).dialog('close');
  10. var wcall=wicketSubmitFormById('datesForm2c8', '?x=CSnkdaEqQF8FdQmRO3bFeuUnAbwwynRD4SmMkMYG2NJadMCSz3AJvOlIUpYFknY*AhBogq0tknoAAc3O7DZ7EU5mAksRg*T7AFItkFMidvtSlMpDYVY02A', 'delete' ,function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$$(this)&amp;&amp;Wicket.$$('datesForm2c8')}.bind(this));;; return false;
  11. },
  12. Cancel: function() {
  13.   $(this).dialog('close');
  14. }
  15. },
  16. close: function (ev, ui) {
  17. $(this).dialog('destroy');
  18. $(this).remove();
  19. }
  20. });
  21. $('#confirm-dialog').dialog('widget').zIndex(25000);
  22. $('#confirm-dialog').dialog('open');
  23. return false;
  24. " role="button" aria-disabled="false">
the problem is after I click the ok button on dialog the function is getting executed   but its something wrong becasue of whihc the form is not posted to server.   I can understand that without the  script for  wicketSubmitFormById  it wont be  easy to understand my problem .
Thanks