Toasts Alert


Message Call from Server Side (Java)
                
/** MessageUtils.java **/
public static final String MSG_TYPE_ERROR = "error";
public static final String MSG_TYPE_WARNING = "warning";
public static final String MSG_TYPE_SUCCESS = "success";

public static final String DISPLAY_TYPE_PIN =  "PIN";
public static final String DISPLAY_TYPE_DIALOG =  "DIALOG";
public static final String DISPLAY_TYPE_PAGE =  "PAGE";

/** Add Message By programmer developing on server side  **/
/** Style 1 : **/
MessageUtils.getResponseMessage(MessageDto messageDto, Object obj);
/** For example **/ 
MessageUtils.getResponseMessage(new MessageDto(MessageUtils.MSG_TYPE_SUCCESS,
  MessageUtils.DISPLAY_TYPE_DIALOG, "LS1400", "Successful",
  "Your application has been received successfully. The application no. is <span style=\"font-weight:bold\">"
      + appNo
      + "</span>, please use this application no. for submitting information relevant to this application to HA."), lsList);
/** Style 2 : **/
MessageUtils.getResponseMessage(List<MessageDto> messageDto, Object obj);
/** For example in Controller **/
/** Default Attribute Name 'toastList' **/ 
List<MessageDto> list = new ArrayList<MessageDto>();
list.add(new MessageDto(MessageUtils.MSG_TYPE_ERROR, MessageUtils.DISPLAY_TYPE_PIN, "search01", "Error", "testing error01"));
list.add(new MessageDto(MessageUtils.MSG_TYPE_ERROR, MessageUtils.DISPLAY_TYPE_PIN, "search02", "Error", "testing error02"));
model.addAttribute("toastList", MessageUtils.getResponseMessage(list, null));

                
              
Message Call from Client Side (Js)
                
toastr["warning"]("Alert Message", "Alert Title", Alert index number , "active"); 
toastr["success"]("Alert Message", "Alert Title", Alert index number , "active"); 
toastr["error"]("Alert Message", "Alert Title", Alert index number , "active");