cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to show error message in popup?

mohammed24
Participant
0 Kudos
436

Hi experts,

I had created an interceptor for product validation for backoffice. Can anyone help me on how to display error message in popup or is there any wiki link to implement the same?

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member1320010
Participant
0 Kudos

You could try this

 public class TextAction  implements CockpitAction<?, String> 
 
 
 
 protected void showErrorMessagebox(String messageLabel, ActionContext<? extends Object> ctx, final ActionResult<String> result, Exception ce, Object[] params) {
 
         String message = params == null ? ctx.getLabel(messageLabel) : ctx.getLabel(messageLabel, params);
         if (message == null) {
             message = messageLabel;
         }
         if (ce != null) {
             getLogger().warn(message + " " + ce.getMessage(), ce);
         } else {
             getLogger().warn(message);
         }
         result.setResultMessage(message);
         Messagebox.show(result.getResultMessage(), ctx.getLabel(MESSAGEBOX_TITLE_ERROR), Messagebox.OK, Messagebox.ERROR);
     }