I have a <rich:fileUpload> component and I want to show a notification when a file is rejected because the type is not allowed. I saw that RF has a <rich:notifyMessage> but I cannot render the message when a file is rejected. So far I have:
<rich:fileUpload id="fileUploadComp"
addLabel="Agregar" clearAllLabel="Quitar todos"
clearLabel="Quitar" deleteLabel="Quitar"
doneLabel="Completado" uploadLabel="Subir archivos"
fileUploadListener="#{uploadBean.doUpload}"
acceptedTypes="txt, csv" onclear="onclear(event);"
noDuplicate="true">
<a4j:ajax event="uploadcomplete" render="validationButton"/>
<a4j:ajax event="typerejected" render="notificationFileRejected"/>
</rich:fileUpload>
<rich:notifyMessage for="fileUploadComp"
id="notificationFileRejected"
sticky="true"
ajaxRendered="true"
title="Hello"/>
but I cannot see any notification globe when I choose a JPEG for instance.
Any idea on how to achieve this?
UPDATE
The main idea of this is to show a notification that tells the user something like “File type not allowed”.
Any idea?
Something like:
With java code:
MAG,
Milo van der Zee