This might not be exactly what you want, but you can do any header contribution using wicket.behavior.HeaderContributor. To make this a little bit easier/ more specific for arbitrairy string contributions, beta 3 has now wicket.behavior.StringHeaderContributor and a neat way to do javascript contributions is using wicket.extensions.util.resource.JavaScriptTemplate. That header contributions (ie a javascript function) can then be called in your onclick script.
Eelco On 4/5/06, Steve Knight <[EMAIL PROTECTED]> wrote: > Okay, now that my indicator is working, I need to add a javascript > confirmation box to appear before my form is submitted. > > With a regular button I just used getOnClickScript(), but I don't see how to > do it with AjaxSubmitButton. Is there someway I can add my javascript call > before the ajax form submission? > > Steve > > > > On 4/5/06, Steve Knight <[EMAIL PROTECTED]> wrote: > > > > I created a quickstart project to demonstrate the problem. Then I decided > to bump the quickstart up to beta 3 and the problem went away. So, I guess > I'll have to upgrade. > > > > Thanks Igor. > > > > > > Steve > > > > > > On 4/4/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > > > > hrm. ok. can you make me a quickstart project that reproduces the > problem? and then i will try it against trunk and tell you if its been > fixed or not. > > > > > > > > > -Igor > > > > > > > > > > > > On 4/4/06, Steve Knight <[EMAIL PROTECTED]> wrote: > > > > > > > > Not easily. I am using Databinder which I think is tied to beta2. > > > > > > > > > > > > Steve > > > > > > > > > > > > > > > > On 4/4/06, Igor Vaynberg <[EMAIL PROTECTED] > wrote: > > > > > > > > > > can you try against trunk or beta3? > > > > > > > > > > > > > > > -Igor > > > > > > > > > > > > > > > > > > > > > > > > > On 4/4/06, Steve Knight <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > I am trying to make an AjaxSubmitButton that uses > WicketAjaxIndicatorAppender to display a busy indicator, but it's not quite > working. I used the IndicatingAjaxLink as a guideline, and everything seems > to work except that the indicator does not disappear after the Ajax call is > completed. > > > > > > > > > > > > Here is my IndicatingAjaxSubmitButton class: > > > > > > > > > > > > abstract class IndicatingAjaxSubmitButton extends AjaxSubmitButton > implements IAjaxIndicatorAware { > > > > > > private final WicketAjaxIndicatorAppender indicatorAppender = > new WicketAjaxIndicatorAppender(); > > > > > > > > > > > > public IndicatingAjaxSubmitButton(String id, > Form form) { > > > > > > super(id, form); > > > > > > add(indicatorAppender); > > > > > > } > > > > > > > > > > > > public String getAjaxIndicatorMarkupId() { > > > > > > return indicatorAppender.getMarkupId (); > > > > > > } > > > > > > } > > > > > > > > > > > > Here is the relevant bit of html that gets generated: > > > > > > > > > > > > <input value="submit via ajax" type="button" > wicket:id="ajax-submit-button" > onclick="wicketShow('ajax-submit-button--ajax-indicator');var > wicketAjaxCallMade=wicketSubmitFormById('selectForm', > '/smarttag2/app?wicket:interface=:0:ajax-submit-button:-1:IUnversionedBehaviorListener&wicket:behaviorId=0' > , function() { > wicketHide('ajax-submit-button--ajax-indicator');});; > return true;" id="ajax-submit-button"/><span style="display:none;" > class="wicket-ajax-indicator" > id="ajax-submit-button--ajax-indicator"><img > src="/smarttag2/app/resources/wicket.ajax.AbstractDefaultAjaxBehavior/indicator.gif"/></span> > > > > > > > > > > > > Am I missing something? > > > > > > > > > > > > > > > > > > Steve > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user