just add a behavior to the link which ads a javascript 'onclick':

public class JavascriptEventConfirmation
        extends AttributeModifier
{
  private static final long serialVersionUID = 1L;

  public JavascriptEventConfirmation( final String event, final String msg )
  {
    super( event, true, new Model( msg ) );
  }

  @Override
  protected String newValue( final String currentValue, final String
replacementValue )
  {
    if( currentValue != null && currentValue.length() != 0 )
    {
      StringBuilder result = new StringBuilder( 256 );
      result.append( "if( confirm('" );
      result.append( escape( replacementValue ) );
      result.append( "') ){" );
      result.append( currentValue );
      result.append( "} else return false;" );
      return (result.toString());
    }
    else
    {
      return ("return confirm('" + escape( replacementValue ) + "')");
    }
  }

  private String escape( final String text )
  {
    if( text == null )
    {
      return (null);
    }

    return (text.replaceAll( "\"", """ ));
  }

}



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

Reply via email to