how to disable icefaces ace:fileentry default messages

how to disable icefaces ace:fileentry default messages

Postby haretu » Wed Jun 26, 2013 9:32 am

first at the interface need set

Code: Select all
              <ice:messages   globalOnly="true"  layout="table"/>
                <h:messages for="fileuploadID" style="display:none;"/>


at the server java code need set message to "null" ID

Code: Select all
FacesContext ctx = FacesContext.getCurrentInstance();
.....
ctx.addMessage(null, msg);
haretu
 
Posts: 132
Joined: Sat Jan 08, 2011 9:56 pm

Re: how to disable icefaces ace:fileentry default messages

Postby haretu » Wed Jun 26, 2013 4:17 pm

this is another way to change icefaces ace:fileentry default messages in JAVA code

Code: Select all
for (FileEntryResults.FileInfo file : results.getFiles()) {
             if (file.isSaved()) {
                 if (!file.getContentType().equals("application/pdf")){
                     file.updateStatus(new FileEntryStatus() {
                             public boolean isSuccess() {
                                 return false;
                             }
                             public FacesMessage getFacesMessage(
                                     FacesContext facesContext, UIComponent fileEntry, FileEntryResults.FileInfo fi) {
                                 return new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                     "Only PDF files can be uploaded. Your upload has been cancelled.",
                                     "Only PDF files can be uploaded. Your upload has been cancelled.");
                             }
                         },
                         true, true);
                 }
             }
         }
haretu
 
Posts: 132
Joined: Sat Jan 08, 2011 9:56 pm


Return to Icefaces

Who is online

Users browsing this forum: No registered users and 1 guest

cron