У меня есть PrimeFaces <p:commandButton update=":messages"
, который не отображает p:messages
после отправки формы, но если я использую update="@all"
вместо этого он делает обновление p:messages
и я могу видеть сообщения, отображаемые.primefaces р: CommandButton свойство обновления не удается обновить р: сообщения компонент
я пробовал много других комбинаций, таких как update="messages"
, update="NewRegistryForm:messages"
, update="@form :messages"
, render=":messages"
... но ничего не похоже на работу. Любая идея, почему это может произойти?
На RegistryInputNewBean.processRequest
я просто обновить компонент сообщения, как это:
FacesContext.getCurrentInstance().addMessage(
null,
new FacesMessage(FacesMessage.SEVERITY_ERROR, "", "error_processing_request")
);
mytemplate.xhtml
, содержащий p:messages
, что-то вроде этого:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
lang="en"
>
<f:view contentType="text/html" encoding="UTF-8" locale="en">
<h:head>
<title>test</title>
</h:head>
<h:body id="pageBody">
<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" showSummary="false"/>
<ui:insert name="content" />
</h:body>
</f:view>
</html>
myform.xhtml
как это:
<!DOCTYPE html>
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
>
<ui:define name="content">
<ui:composition template="mytemplate.xhtml">
<h:form id="NewRegistryForm">
<p:commandButton
id="sendButton"
type="submit"
action="#{registryInputNewBean.processRequest}"
update="@all"
style="display:none" />
</h:form>
</ui:composition>
</ui:define>
</html>
Да вы могли бы , но приведет ли это к другому поведению, чем использование 'update' в' p: commandButton'? –