You could try iterating thru the FeedBackMessage List

Using something like:

    @Override
    public void renderHead(IHeaderResponse response) {
          super.renderHead(response);
          FeedbackMessages messages = 
WebSession.get().getFeedbackMessages();
          if(!messages.isEmpty()){
             //Iterate thru the messagesList and build a nice JavaScript
Alert Message
            
response.renderOnLoadJavascript(buildJSAlertFeedback(messages));
          }
     }
     private String buildJSAlertFeedback(FeedbackMessages  messages){
         .....
         return .....;
     }



john.mattucci wrote:
> 
> I need to display messages via a javascript alert box rather than .error
> or .info messages which is provided in Component. I currently have the
> following. The problem is that the message remains. The alert appears
> whenever there is an error however how do I remove it? And is this the
> best approach? Thank you.
>     .. extends AbstractBehavior {
>     private String message;
> 
>     public void setMessage(String message) {
>       this.message = message;
>     }
> 
>     @Override
>     public void renderHead(IHeaderResponse response) {
>         super.renderHead(response);
>                response.renderOnLoadJavascript("alert('" + message +
> "');");
>         }
> 
> 
> ********************
> NOTICE OF CONFIDENTIALITY
> This communication including any information transmitted with it is 
> intended only for the use of the addressees and is confidential. 
> If you are not an intended recipient or responsible for delivering 
> the message to an intended recipient, any review, disclosure, 
> conversion to hard copy, dissemination, reproduction or other use 
> of any part of this communication is strictly prohibited, as is the 
> taking or omitting of any action in reliance upon this communication. 
> If you receive this communication in error or without authorization 
> please notify us immediately by return e-mail or otherwise and 
> permanently delete the entire communication from any computer, 
> disk drive, or other storage medium.
> 
> If the above disclaimer is not properly readable, it can be found at 
> www.td.com/legal
>                                                            
> AVERTISSEMENT DE CONFIDENTIALITE                   
> Ce courriel, ainsi que tout renseignement ci-inclus, destiné uniquement 
> aux destinataires susmentionnés,  est confidentiel.  Si vous 
> n'êtes pas le destinataire prévu ou un agent responsable de la 
> livraison de ce courriel, tout examen, divulgation, copie, impression, 
> reproduction, distribution, ou autre utilisation d'une partie de ce 
> courriel est strictement interdit de même que toute intervention ou 
> abstraction à cet égard.  Si vous avez reçu ce message par erreur ou 
> sans autorisation, veuillez en aviser immédiatement l'expéditeur par 
> retour de courriel ou par un autre moyen et supprimer immédiatement 
> cette communication entière de tout système électronique.
> 
> Si l'avis de non-responsabilité ci-dessus n'est pas lisible, vous 
> pouvez le consulter à www.td.com/francais/legale
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-do-I-call-alert%28%29--rather-than-using-.info-or-.error-of-Component-tp22789324p22789715.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to