Thanks everyone.. just in case anyone wants it. this is what is did

public abstract class ConfirmAjaxButton extends IndicatingAjaxButton
{

    private String message;
    
    public ConfirmAjaxButton(String id, String message, Form form)
    {
        super(id,form);
        this.message = message;
    }
    
 @Override
 protected IAjaxCallDecorator getAjaxCallDecorator()
 {
  return new AjaxPreprocessingCallDecorator(super.getAjaxCallDecorator())
  {
   @Override
   public CharSequence preDecorateScript(CharSequence script)
   {
    return "if(!confirm('" + message
      + "')) return false;" + script;
   }
  };
 
}

}



Ryan Gravener-3 wrote:
> 
> decorateScript(java.lang.CharSequence script) {
> 
> return "if(confirm('Are you sure?')) {" + script " + "}";
> 
> }
> 
> On Tue, Apr 1, 2008 at 10:03 PM, Pinger <[EMAIL PROTECTED]> wrote:
>>
>>  Opps I think I deleted my reply somehow.. Anyway I said if you could
>> post
> a
>>
>>
>> code example of the behavior you made, you would be my hero :)
>>
>>  djo.mos wrote:
>>  >
>>  > Hi,
>>  >
>>  > Pinger wrote:
>>  >>
>>  >> I want to get a Yes/No confirm dialog, so I only "Do Stuff" if they
> say
>>  >> yes..
>>  >>
>>  >
>>  > What kind of confirmation ? Javascript ? Html ?
>>  > for the first, you could use this
>>  >
>>  > ajaxButton.add(new SimpleAttributeModifier("onclick", "return
>>  > confirm('Delete ?');"));
>>  >
>>  > Cheers
>>  >
>>
>>  --
>>  View this message in context:
> http://www.nabble.com/Make-a-Ajax-button-have-a-confirm-dialog-tp16425091p16436264.html
>>  Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>>  For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> 
> -- 
> Ryan Gravener
> http://ryangravener.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Make-a-Ajax-button-have-a-confirm-dialog-tp16425091p16447228.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to