我在a4j:jsFunction
下面和<h:message for="form" style="color:red" />
页面上的其他地方有这个。
<h:form id="form">
<a4j:jsFunction id="createEvent" name="createEvent" immediate="true"
action="#{calendarController.createEvent()}"
data="#{calendarController}"
oncomplete="renderEvent(event.data.eventId, event.data.eventTitle)">
<a4j:param name="eventTitle"
assignTo="#{calendarController.eventTitle}" />
</a4j:jsFunction>
</h:form>
如何添加生成的错误消息calendarController.createEvent()
?
试过了,context.addMessage("form", new FacesMessage(e.getMessage()));
但它不起作用。我收到此错误:WARNING: There are some unhandled FacesMessages, this means not every FacesMessage had a chance to be rendered.