Displaying messagebox from backing bean

This piece of code snippet will initially hide the primefaces dialog box, then in any action from the backing bean, it will be activated and seen

Back bean

RequestContext context = RequestContext.getCurrentInstance();
			context.execute("PF('dlgBlackListVar').show();");

View

<p:dialog id="dlgBlackList" widgetVar="dlgBlackListVar"
						header="#{msg.member_blacklist_header}" showEffect="clip" modal="true"
						visible="false">
						<h:outputText value="#{msg.member_blacklist_content}" />
					</p:dialog>

Leave a Reply

Your email address will not be published. Required fields are marked *