RichFaces fileupload und h:message problem

Ich bin mit RichFaces 4. Mein problem ist, dass die message nicht angezeigt. Wenn ich Reich:Nachricht die Nachricht wird kurz angezeigt dann verschwindet.

Dies ist die Steuerung:

public void uploadListener(final FileUploadEvent event) throws IOException
{
    final UploadedFile item = event.getUploadedFile();

    final FacesContext context = FacesContext.getCurrentInstance();
    final Application application = context.getApplication();
    final String messageBundleName = application.getMessageBundle();
    final Locale locale = context.getViewRoot().getLocale();
    final ResourceBundle resourceBundle = ResourceBundle.getBundle(messageBundleName, locale);

    final String msg = resourceBundle.getString("upload.failed");
    final String detailMsgPattern = resourceBundle.getString("upload.failed_detail");

    try
    {
        CSVImporter.doImport(item.getInputStream(), registry, item.getName());
    }
    catch (ParseException e)
    {
        final Object[] params = {item.getName(), e.getMessage()};
        final String detailMsg = MessageFormat.format(detailMsgPattern, params);
        final FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, detailMsg);

        context.addMessage("uploadForm:uploader", facesMsg);
    }
    catch (TokenMgrError e)
    {
        final Object[] params = {item.getName(), e.getMessage()};
        final String detailMsg = MessageFormat.format(detailMsgPattern, params);
        final FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, detailMsg);

        context.addMessage("uploadForm:uploader", facesMsg);
    }
}

- Und dies ist die Ansicht:

<h:form id="uploadForm" enctype="multipart/form-data">
    <h:message id="message" showDetail="true" for="uploader" errorClass="error" warnClass="warning" infoClass="info" fatalClass="fatal"/>
    <rich:fileUpload id="uploader"
             fileUploadListener="#{itemController.uploadListener}"
                 maxFilesQuantity="1"
                 acceptedTypes="csv">
        <a4j:ajax event="uploadcomplete" execute="@none" render="items, message" />
    </rich:fileUpload>
</h:form>

In beiden Fällen Firebug meldet einen leeren Feld Nachricht gesendet wird.

<?xml version='1.0' encoding='UTF-8'?>
<partial-response><changes><update id="uploadForm:message"><![CDATA[<span id="uploadForm:message"></span>]]></update><update id="j_idt16:items"><![CDATA[<table id="j_idt16:items">
<thead>
<tr>
<th scope="col">
                        Titles
                    </th>
</tr>
</thead>
<tbody>
<tr><td></td></tr></tbody>
</table>
]]></update><update id="javax.faces.ViewState"><![CDATA[8859542538952100446:6041172679113548382]]></update></changes></partial-response>
Schreibe einen Kommentar