Given the following list of <p:selectOneRadio>.
<p:selectOneRadio layout="grid" columns="1" value="#{1}">
<f:selectItem id="paypal" itemValue="1" itemLabel="Paypal"/>
<f:selectItem id="wireTransfer" itemValue="2" itemLabel="Wire Transfer"/>
</p:selectOneRadio>
Is it possible to display an image as a label of <f:selectItem> so that the list looks something like the following?
I tried using a <p:outputLabel> placing a <p:graphicImage> inside and removing the itemLabel attribute from the<f:selectItem> inside the <p:selectOneRadio> but either way it did not work.
<p:outputLabel for="paypal">
<p:graphicImage library="default" name="images/payments/paypal_logo.jpeg"/>
</p:outputLabel>
You can solve it using the SelectOneRadio - Custom Layout
Here an example:
<h3>Custom Layout</h3>
<p:outputPanel id="customPanel" style="margin-bottom:10px">
<p:selectOneRadio id="customRadio" value="#{radioView.color}" layout="custom">
<f:selectItem itemLabel="Red" itemValue="Red" />
<f:selectItem itemLabel="Green" itemValue="Green" />
<f:selectItem itemLabel="Blue" itemValue="Blue" />
</p:selectOneRadio>
<h:panelGrid columns="3" cellpadding="5">
<p:radioButton id="opt1" for="customRadio" itemIndex="0" />
<h:outputLabel for="opt1" value="Red" />
<p:spinner />
<p:radioButton id="opt2" for="customRadio" itemIndex="1" />
<h:outputLabel for="opt2" value="Green" />
<p:inputText />
<p:radioButton id="opt3" for="customRadio" itemIndex="2" />
<h:outputLabel for="opt3" value="Blue" />
<p:calendar />
</h:panelGrid>
</p:outputPanel>
<p:selectOneRadio id="customRadio" value="#{radioView.image}" layout="custom">
<f:selectItem itemLabel="Image1" itemValue="Image1" />
<f:selectItem itemLabel="Image2" itemValue="Image2" />
</p:selectOneRadio>
<h:panelGrid columns="2" cellpadding="5">
<p:radioButton id="opt1" for="customRadio" itemIndex="0" />
<h:graphicImage value="/some/image2.png"/>
<p:radioButton id="opt2" for="customRadio" itemIndex="1" />
<h:graphicImage value="/some/image2.png"/>
<h:panelGrid columns="3" cellpadding="5">
Related
I'm using 6.1 version of PrimeFaces community. With the below code that is copied from PrimeFaces selectoneradio page, I tried to send wihtout any selection and it is not giving any error. When I upgrade the version to 7.0, it gives error, required true is working, but I have to stay on 6.1 version.
On PrimeFaces 6.1, is there any bug for this situtaion? Or is there a different usage to do my purpose on PrimeFaces 6.1?
<h3>Custom Layout</h3>
<p:outputPanel id="customPanel" style="margin-bottom:10px">
<p:selectOneRadio id="customRadio" layout="custom" required="true">
<f:selectItem itemLabel="Red" itemValue="Red" />
<f:selectItem itemLabel="Green" itemValue="Green" />
<f:selectItem itemLabel="Blue" itemValue="Blue" />
</p:selectOneRadio>
<h:panelGrid columns="3" cellpadding="5">
<p:radioButton id="opt1" for="customRadio" itemIndex="0" required="true" />
<h:outputLabel for="opt1" value="Red" />
<p:spinner />
<p:radioButton id="opt2" for="customRadio" itemIndex="1" required="true"/>
<h:outputLabel for="opt2" value="Green" />
<p:inputText />
<p:radioButton id="opt3" for="customRadio" itemIndex="2" required="true"/>
<h:outputLabel for="opt3" value="Blue" />
<p:calendar />
</h:panelGrid>
</p:outputPanel>
I am using Primefaces 4.0 Datatable with a paginator. The table lies right under a
accordionPanel wich can expand or collapse, affecting the layout of the page.
Unfortunately, the paginator of the datatable doesn't move when the accordion animation is performed.
BEFORE EXPANDING the accordion:
AFTER EXPANDING the accordion:
I have kinda taken the code from primefaces showcase, and didn't touch it much, but anyway here's what is in my xhtml:
Any idea of what i'm doing wrong?
TABLE CODE:
<p:dataTable id="idDataTable" value="#{analysisBean.listOfSamu}" var="nthSamu" rows="10"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
selectionMode="single">
<p:column headerText="ID" sortBy="#{nthSamu.idSamu}" filterBy="#{nthSamu.idSamu}" filterMatchMode="contains">
<h:outputText value="#{nthSamu.idSamu}"/>
</p:column>
<p:column headerText="EJE" sortBy="#{nthSamu.nombre}" filterBy="#{nthSamu.nombre}" filterMatchMode="contains">
<h:outputText value="#{nthSamu.nombre}"/>
</p:column>
<p:column headerText="EJE" sortBy="#{nthSamu.primerApellido}" filterBy="#{nthSamu.primerApellido}" filterMatchMode="contains">
<h:outputText value="#{nthSamu.primerApellido}"/>
</p:column>
<p:column headerText="IM" sortBy="#{nthSamu.importe}" filterBy="#{nthSamu.importe}" filterMatchMode="contains">
<h:outputText value="#{nthSamu.importe}"/>
</p:column>
<p:column headerText="FE" sortBy="#{nthSamu.fecha}" filterBy="#{nthSamu.fecha}" filterMatchMode="contains">
<h:outputText value="#{nthSamu.fecha}"/>
</p:column>
</p:dataTable>
ACCORDION CODE:
enter code her <p:fieldset legend="Filtros" style="width: 40%" >
<h:panelGrid columns="1">
<p:accordionPanel multiple="true" style="width: 100%">
<p:tab title="Acerca del Giro">
<h:panelGrid columns="5">
<h:column>
<h:outputLabel style="vertical-align:middle" value="Oficina: " />
<p:selectOneMenu id="oficinaSelect" style="vertical-align:middle">
<f:selectItem itemLabel="Todos" itemValue="Todos" />
<f:selectItem itemLabel=" Naguaes" itemValue=" Naguaes" />
<f:selectItem itemLabel=" aguaes" itemValue=" aguaes" />
<f:selectItem itemLabel="Naguaes" itemValue=" s Naguaes" />
<f:selectItem itemLabel="aguaes" itemValue=" s aguaes" />
</p:selectOneMenu>
</h:column>
<h:column>
<h:outputLabel style="vertical-align:middle" value="País: "/>
<p:selectOneMenu id="paisSelect" style="vertical-align:middle">
<f:selectItem itemLabel="Todos" itemValue="Todos" />
<f:selectItem itemLabel="Naguaes" itemValue=" Naguaes" />
<f:selectItem itemLabel="aguaes" itemValue=" aguaes" />
<f:selectItem itemLabel="Naguaes" itemValue=" s Naguaes" />
<f:selectItem itemLabel="aguaes" itemValue=" s aguaes" />
</p:selectOneMenu>
</h:column>
</h:panelGrid>
</p:tab>
<p:tab title="Acerca del Ejecutor">
<h:panelGrid columns="5">
<p:graphicImage url="images/usericon.png" width="30" height="30" style="border: 3px solid activecaption"/>
<h:column>
<h:outputLabel value="Naguaidad:" style="vertical-align:middle"/>
<p:selectOneMenu id="idNaguaidadSelect2" style="vertical-align:middle">
<f:selectItem itemLabel="Todos" itemValue="Todos" />
<f:selectItem itemLabel="aguaes" itemValue=" Naguaes" />
<f:selectItem itemLabel="guaes" itemValue=" aguaes" />
<f:selectItem itemLabel="Naguaes" itemValue=" s Naguaes" />
<f:selectItem itemLabel="aguaes" itemValue=" s aguaes" />
</p:selectOneMenu>
</h:column>
<h:column>
<h:outputLabel value=" Porto NInj:" style="vertical-align:middle" />
<p:selectOneMenu id="id PortoNInjSelect" style="vertical-align:middle">
<f:selectItem itemLabel="Todos" itemValue="Todos" />
<f:selectItem itemLabel="aguaes" itemValue=" Naguaes" />
<f:selectItem itemLabel="guaes" itemValue=" aguaes" />
<f:selectItem itemLabel="Naguaes" itemValue=" s Naguaes" />
<f:selectItem itemLabel="aguaes" itemValue=" s aguaes" />
</p:selectOneMenu>
</h:column>
<h:column>
<h:outputLabel value="Actividad:" style="vertical-align:middle"/>
<p:selectOneMenu id="idActividadSelect" style="vertical-align:middle">
<f:selectItem itemLabel="Todos" itemValue="Todos" />
<f:selectItem itemLabel=" Naguaes" itemValue=" Naguaes" />
<f:selectItem itemLabel=" aguaes" itemValue=" aguaes" />
<f:selectItem itemLabel=" s Naguaes" itemValue=" s Naguaes" />
<f:selectItem itemLabel=" s aguaes" itemValue=" s aguaes" />
</p:selectOneMenu>
</h:column>
</h:panelGrid>
</p:tab>
</p:accordionPanel>
<p:commandButton id="idFiltrarCommandButton2" style="float:right" icon="ui-icon-search" value="Filtrar" action="#{analysisBean.populateList()}" update="idDataTable"></p:commandButton>
</h:panelGrid>
</p:fieldset>
I'm fairly with prime-faces. Seems like you need to have the dataTable and the accordionPanel within two seperate forms and panels. I would recommend doing something like,
Code:
<Dialogue>
<Form1>
<Panel>
Datatable
</panel>
</Form1>
<Form2>
<panel>
AccordionPanel
</panel>
</Form2>
</Dialogue>
just don't forget to update the respective forms accordingly
I have a drop down menu which will add new row of input fields as follows:
<h:selectOneMenu id="selBillingSelect" rendered="#participantController.enableMultipleBilling}" title="#{awbInformationorderBundle.RATING_DETAILS_ADD_LBL_TIP}" tabindex="#{headerBean.tabIndex}" styleClass="optional" value="#{participantController.numberOfRows}" accesskey="6" style="vertical-align:bottom">
<f:ajax event="change" listener="#{participantController.addBillingLines}" render=":frmParticipantInfo:billingTable hidBillingSize" execute=":frmParticipantInfo:billingTable" onevent="billingAutoExpansion" />
<f:selectItem itemValue="0" itemLabel="Add a Carrier" />
<f:selectItem itemValue="1" itemLabel="1" />
<f:selectItem itemValue="2" itemLabel="2" />
<f:selectItem itemValue="3" itemLabel="3" />
<f:selectItem itemValue="4" itemLabel="4" />
</h:selectOneMenu>
backing bean code to add data
public void addBillingLines(){
BillingPartsInfoDto aBillingPartsInfoDto = null;
for (int i = 0; i < this.getNumberOfRows(); i++) {
if(this.getBillingSize()<this.getMaxAirlineCodeAllowed()){
aBillingPartsInfoDto= new BillingPartsInfoDto();
billingInfoDtos.add(aBillingPartsInfoDto);
this.setBillingSize(this.getBillingInfoDtos().size());
}
}
this.setNumberOfRows(0);
return;
}
i have a a4j:repeat to display the data as follows:
<h:panelGroup id="billingTable"></h:panelGroup>
<a4j:repeat id="billingLines#{rowIndex}" var="item" keepSaved="true" value="#{participantController.billingInfoDtos}" rowKeyVar="rowIndex"> <cc:customTable id="billingTable"> <cc:customTr styleClass="fieldTitle"> <cc:customTd valign="center"> <h:outputText value="Carrier Code" escape="false" /> </cc:customTd> <cc:customTd valign="center"> <h:outputText value="#{participantBundle.BILLING_INVOICE_MEDIA_LBL}" escape="false" /> </cc:customTd> <cc:customTd><h:outputText styleClass="spacer20" /> </cc:customTd><cc:customTd valign="center"> <h:outputText value="#participantBundle.BILLING_INVOICE_FREQUENCY_LBL}" escape="false" /></cc:customTd><cc:customTd><h:outputText tyleClass="spacer20" />
<cc:customTd valign="center">
<h:outputText value="#{participantBundle.BILLING_INVOICE_SEQUENCE_LBL}" escape="false" /></cc:customTd>
<cc:customTd>
<h:outputText styleClass="spacer20" />
</cc:customTd>
<cc:customTd valign="center">
<h:outputText
value="#{participantBundle.BILLING_INVOICE_LANGUAGE_LBL}"
escape="false" />
</cc:customTd>
<cc:customTd>
<h:outputText styleClass="spacer20" />
</cc:customTd>
<cc:customTd valign="center">
<h:outputText
value="#{participantBundle.BILLING_INVOICE_SITE_LBL}"
escape="false" />
</cc:customTd>
<cc:customTd>
<h:outputText styleClass="spacer20" />
</cc:customTd>
<cc:customTd valign="center">
<h:outputText
value="#{participantBundle.BILLING_CURRENCY_LBL}"
escape="false" />
</cc:customTd>
<cc:customTd>
<h:outputText styleClass="spacer20" />
</cc:customTd>
<cc:customTd>
<h:outputText style="vertical-align:top;"
value="#{participantBundle.DETAILS_INVOICE_EMAIL_LBL}" />
</cc:customTd>
</cc:customTr>
<cc:customTr>
<cc:customTd valign="top">
<h:selectOneMenu id="carrierCode" value="#{item.airline}"
title="#{participantBundle.INVOICE_MEDIA_TIP}" rendered="#{participantController.enableMultipleBilling}"
tabindex="#{headerBean.tabIndex}" style="width:50px;"
accesskey="#{participantBundle.BILLING_INVOICE_MEDIA_AKEY}"
styleClass="required">
<f:selectItems value="#{participantController.specificAirlines}"></f:selectItems>
</h:selectOneMenu>
</cc:customTd>
<cc:customTd>
<h:selectOneMenu id="invoiceMedia1"
value="#{item.invoiceMedia}"
title="#{participantBundle.INVOICE_MEDIA_TIP}"
tabindex="#{headerBean.tabIndex}"
accesskey="#{participantBundle.BILLING_INVOICE_MEDIA_AKEY}"
styleClass="required">
<f:selectItem itemLabel=" " itemValue=" " />
<f:selectItem itemLabel="Descriptive"
itemValue="Descriptive" />
<f:selectItem itemLabel="CASS Tape" itemValue="CASS Tape" />
<f:selectItem itemLabel="Government Form"
itemValue="Government Form" />
<f:selectItem itemLabel="Literal" itemValue="Literal" />
<f:selectItem itemLabel="Tape" itemValue="Tape" />
<f:selectItem itemLabel="Email" itemValue="Email" />
<f:selectItem itemLabel="FTP" itemValue="FTP" />
<f:converter converterId="EnumConverter"></f:converter>
</h:selectOneMenu>
</cc:customTd>
<cc:customTd></cc:customTd>
<cc:customTd>
<h:selectOneMenu id="invoiceFrequency"
value="#{item.invoiceFrequency}"
title="#{participantBundle.INVOICE_FREQUENCY_TIP}"
tabindex="#{headerBean.tabIndex}" styleClass="required">
<f:selectItem itemLabel=" " itemValue=" " />
<f:selectItem itemLabel="Weekly" itemValue="Weekly" />
<f:selectItem itemLabel="Bi-Monthly"
itemValue="Bi-Monthly" />
<f:selectItem itemLabel="Daily" itemValue="Daily" />
<f:selectItem itemLabel="Demand" itemValue="Demand" />
<f:selectItem itemLabel="Monthly" itemValue="Monthly" />
<f:selectItem itemLabel="10 days" itemValue="10 days" />
<f:converter converterId="EnumConverter"></f:converter>
</h:selectOneMenu>
</cc:customTd>
<cc:customTd></cc:customTd>
<cc:customTd>
<h:selectOneMenu id="invoiceSequence"
value="#{item.invoiceSequence}"
title="#{participantBundle.INVOICE_SEQUENCE_TIP}"
tabindex="#{headerBean.tabIndex}" styleClass="required">
<f:selectItem itemLabel=" " itemValue=" " />
<f:selectItem itemLabel="Ascending Order"
itemValue="Ascending Order" />
<f:selectItem itemLabel="Double Space"
itemValue="Double Space" />
<f:converter converterId="EnumConverter"></f:converter>
</h:selectOneMenu>
</cc:customTd>
<cc:customTd>
<h:inputText id="txtInvoiceLanguage"
value="#{item.invoiceLanguage}"
tabindex="#{headerBean.tabIndex}" size="3" maxlength="3"
styleClass="required"
title="#{participantBundle.INVOICE_LANGUAGE_TIP}" />
</cc:customTd>
<cc:customTd></cc:customTd>
<cc:customTd>
<h:inputText id="txtSite"
value="#{item.invoiceSite}"
tabindex="#{headerBean.tabIndex}" size="3" maxlength="3"
styleClass="required"
title="#{participantBundle.INVOICE_SITE_TIP}" />
</cc:customTd>
<cc:customTd></cc:customTd>
<cc:customTd>
<h:inputText id="txtBillingCurrency"
value="#{item.currency}"
tabindex="#{headerBean.tabIndex}" size="3" maxlength="3"
styleClass="required"
title="#{participantBundle.BILLING_CURRENCY_TIP}" />
</cc:customTd>
<cc:customTd></cc:customTd>
<cc:customTd>
<h:inputText id="txtInvoiceEmail"
style="vertical-align:top;"
value="#{item.invoiceEmail}"
size="45" maxlength="68" styleClass="optional"
title="#{participantBundle.DETAILS_EMAIL_TIP}" /></cc:customTd></cc:customTr></cc:customTable>
</a4j:repeat>
The problem is when I add a new row using the drop down and then set the value to the input box in the a4j:repeat component and submit form , the backing bean is set with with null value for all the fields.
Where as when i don't add any new row and save form the data is saved in the backend.
I think its because every time you are adding new objects of aBillingPartsInfoDto to the list billingInfoDtos and not set any values to the dto variables.
if(this.getBillingSize()<this.getMaxAirlineCodeAllowed()){
aBillingPartsInfoDto= new BillingPartsInfoDto();
/* Set values to dto variables here */
billingInfoDtos.add(aBillingPartsInfoDto);
this.setBillingSize(this.getBillingInfoDtos().size());
}
Following is my code:
<p:contentFlow value="#{fileOnDeskViewDlgBacking.filesContentFlowList}" var="row">
<p:panel styleClass="filePanel" >
<p:outputLabel value="#{row.srNo}" />
<p:panelGrid styleClass="borderless" columns="2">
<p:graphicImage name="/dashboard/images/file_64px.png"/>
<p:panelGrid styleClass="borderless" columns="1">
<p:outputLabel value="(#{row.subject})" />
</p:panelGrid>
</p:panelGrid>
<p:outputLabel style="color:#3D83B5;" value="Files#{row.date}">
<f:convertDateTime pattern="dd/mm/yyy HH:mm" />
</p:outputLabel>
<h:panelGrid styleClass="borderless" columns="2">
<p:outputLabel value="FileId:" />
<p:outputLabel styleClass="wrapText" value="#{row.Id}" />
<p:outputLabel value="Description:" />
<p:outputLabel styleClass="wrapText" value="#{row.description}" />
<p:outputLabel value="Heading:" />
<p:outputLabel value="#{row.name}" />
<p:outputLabel value="Priority:" />
<p:outputLabel value="#{row.priorityName}" />
<p:outputLabel value="Type:" />
<p:outputLabel value="#{row.typeName}" />
<!-- <p:outputLabel value="Created By:" />
<p:outputLabel value="#{row.createdBy}" /> -->
</h:panelGrid>
<p:spacer height="5px" />
<p:separator />
<p:commandButton value="#{row.fileId}" action="#{fileOnDeskViewDlgBacking.fileNoting(row.fileId)}" />
</p:panel>
</p:contentFlow>
The problem is here on button <p:commandButton value="#{row.fileId}" action="#{fileOnDeskViewDlgBacking.fileNoting(row.fileId)}" /> the method does not pass fileId and it resolved to null, where as #{row.fileId} alwasys give its value.
MORE
It do work in p:dataTable, there is any problem with the component i think.
I tried populating the collection in the #PostConstruct method, then a NPE is thrown.
Also tried redirecting, but I get IllegalStateException: Response already committed.
this.networks = this.getNetworks();
if (this.networks.isEmpty()) {
JsfUtils jsfUtils = new JsfUtils();
jsfUtils.displayMessage("WARN", "No network inserted!", "Insert a network!");
}
Then I tried using FacesMessage directly inside the getter method. The message isn't shown, though the method is being executed since I see the message in the console.
public List<Network> getNetworks() {
if (this.networks == null) {
networks = networkBean.findWithNamedQuery("Network.findAll");
if (networks.isEmpty()) {
FacesContext fc = FacesContext.getCurrentInstance();
fc.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN,"Insert a network!",""));
System.out.println(">>>>>>>>>>>> Insert a Network!");
}
}
return networks;
}
Using the same structure as the first in a #PostLoad method also doesn't display any message.
Page code:
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:jsf="http://xmlns.jcp.org/jsf" xmlns:p="http://primefaces.org/ui" xmlns:pt="http://xmlns.jcp.org/jsf/passthrough" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
template="/WEB-INF/tpl/template1.xhtml">
<ui:define name="title">Add Stablishment</ui:define>
<ui:define name="header">Add Stablishment</ui:define>
<ui:define name="content">
<h:form id="form" enctype="multipart/form-data">
<p:growl id="growl" autoUpdate="true" showDetail="true" sticky="true" globalOnly="true" />
<h:panelGrid columns="3" cellpadding="5">
<p:outputLabel for="categories" value="Category:" />
<p:selectOneMenu id="categories" value="#{stablishmentMB.category.id}">
<f:selectItem itemValue="" itemLabel="-- Select --" noSelectionOption="true" />
<f:selectItems value="#{stablishmentCategoryMB.categories}" var="category" itemLabel="#{category.name}" itemValue="#{category.id}" />
</p:selectOneMenu>
<p:message for="categories" />
<p:outputLabel for="networks" value="Network:" />
<p:selectOneMenu id="networks" value="#{stablishmentMB.network.id}">
<f:selectItem itemValue="" itemLabel="-- Selecione --" noSelectionOption="true" />
<f:selectItems value="#{networkMB.networks}" var="network" itemLabel="#{network.tradeName}" itemValue="#{network.id}" />
</p:selectOneMenu>
<p:message for="networks" />
<p:outputLabel for="cnpj" value="CNPJ:" />
<p:inputMask id="cnpj" pt:placeholder="99.999.999/9999-99" mask="99.999.999/9999-99" value="#{stablishmentMB.stablishment.cnpj}" required="true" />
<p:message for="cnpj" />
<p:outputLabel for="companyName" value="Company Name:" />
<p:inputText id="companyName" value="#{stablishmentMB.stablishment.companyName}" required="true" />
<p:message for="companyName" />
<p:outputLabel for="tradeName" value="Trade Name:" />
<p:inputText id="tradeName" value="#{stablishmentMB.stablishment.tradeName}" required="true" />
<p:message for="tradeName" />
<p:outputLabel for="zipCode" value="Zip Code:" />
<p:inputMask id="zipCode" mask="99999-999" value="#{stablishmentMB.zipCode.number}" required="true">
<p:ajax event="blur" listener="#{stablishmentMB.findByZipCode}" update="street neighbourhood city state" />
</p:inputMask>
<p:message for="zipCode" />
<p:outputLabel for="state" value="State:" />
<p:inputText id="state" value="#{stablishmentMB.state.abbreviation}" required="true" />
<p:message for="state" />
<p:outputLabel for="city" value="City:" />
<p:inputText id="city" value="#{stablishmentMB.city.nome}" required="true" />
<p:message for="city" />
<p:outputLabel for="neighbourhood" value="Neighbourhood:" />
<p:inputText id="neighbourhood" value="#{stablishmentMB.neighbourhood.nome}" />
<p:message for="neighbourhood" />
<p:outputLabel for="street" value="Street:" />
<p:inputText id="street" value="#{stablishmentMB.street.name}" required="true" />
<p:message for="street" />
<p:outputLabel for="number" value="Nº:" />
<p:inputText id="number" value="#{stablishmentMB.stablishment.number}" required="true" />
<p:message for="number" />
<p:outputLabel for="complement" value="Complement:" />
<p:inputText id="complement" value="#{stablishmentMB.stablishment.complement}" />
<p:message for="complement" />
<p:outputLabel for="telephone" value="Telephone:" />
<p:inputMask mask="(99) 9999-9999" id="telephone" value="#{stablishmentMB.stablishment.telephone}" />
<p:message for="telephone" />
<p:outputLabel for="contact" value="Contact:" />
<p:inputText id="contact" value="#{stablishmentMB.stablishment.contact}" />
<p:message for="contact" />
<p:outputLabel for="email" value="E-mail:" />
<p:inputText id="email" value="#{stablishmentMB.stablishment.email}" />
<p:message for="email" />
<p:outputLabel for="site" value="Site:" />
<p:inputText id="site" value="#{stablishmentMB.stablishment.site}" />
<p:message for="site" />
<p:outputLabel for="latitude" value="Latitude:" />
<p:inputText id="latitude" value="#{stablishmentMB.stablishment.latitude}" />
<p:message for="latitude" />
<p:outputLabel for="longitude" value="Longitude:" />
<p:inputText id="longitude" value="#{stablishmentMB.stablishment.longitude}" />
<p:message for="longitude" />
<p:commandButton action="#{stablishmentMB.save}" value="Save" update="#form" />
</h:panelGrid>
</h:form>
</ui:define>
You should remove your code from the getter because a getter is not mean to do such staff and always #PostConstruct will be executed before any getter on your bean!
A quick fix to your problem is to move <p:growl> to the end of page this will make your bean construction happens before the renderer try to render <p:growl>.