Displaying messagebox from backing bean

Reading Time: < 1 minute

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>