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.
Related
I have this code, I want to gain advantage of the left space (Not filed value)...
[![<h:panelGrid columns="2" cellpadding="5" >
<p:outputLabel value="Field1:" for="itField1" />
<p:inputText id="itField1" style="width:200px" required="true"
value="#{bean.field1}">
</p:inputText>
<p:outputLabel value="Field2:" for="itField2" />
<h:panelGrid columns="2" style="width:200px" cellpadding="0" cellspacing="0" >
<p:inputText id="itField2" required="true"
value="#{="#{bean.field2}"
/>
<p:commandButton icon="fa fa-search"
/>
</h:panelGrid>
<p:outputLabel value="Field3:" for="itField3" />
<p:inputText id="itField3" style="width:200px" required="true"
value="#{bean.field3}">
</p:inputText>
</h:panelGrid>]
I want this!
But, I get that :( :
How to do it?
This can be achieved by adding CSS style width:100% to <p:inputText id="itField2" ..... /> and <p:commandButton .... />as follows:
<p:inputText id="itField2" value="#{bean.field2}" required="true" style="width:100%" />
<p:commandButton icon="fa fa-search" style="width:100%" />
I implement a <h:form> to edit Employee data which gets preloaded from the database. The preload works fine - all fields get filled with data. The <h:form id="editEmployeeForm"> is surrounded by a <h:form> which contains a <p:dataTable>.
When I do an edit on Employee data and click the "Speichern"-button nothing happens. <p:messages> says all my fields are empty what is obviously a wrong validation because all fields are prefilled. Then I deleted all <p:message> tags from my <h:inputText> tags to check whether the doSaveEmployeeEdit() gets called at all. But nothing happens - no error in console, etc. Even a simple System.out.println() doesn't get printed from the doSaveEmployeeEdit() at all.
Below the <p:dialog> what I have at the time:
<h:form id="editEmployeeForm">
<p:dialog header="Angestellten ändern" id="employeeEditDialog" widgetVar="employeeEditDialog" modal="true" showEffect="fade" hideEffect="fade" resizable="false" closeOnEscape="true">
<p:outputPanel id="employeeDataEdit" rendered="#{not empty employeeEditController.employee}">
<h:panelGrid columns="2">
<p:outputLabel for="usernameEdit" value="Benutzername: " />
<p:inputText id="usernameEdit" value="#{employeeEditController.employee.username}" disabled="true" />
</h:panelGrid>
<p:separator/>
<h:panelGrid columns="6">
<p:outputLabel for="firstnameEdit" value="Vorname: " />
<p:inputText id="firstnameEdit" value="#{employeeEditController.employee.firstName}" />
<p:outputLabel for="lastnameEdit" value="Nachname: " />
<p:inputText id="lastnameEdit" value="#{employeeEditController.employee.lastName}" />
<p:outputLabel for="birthdayEdit" value="Geburtsdatum: " />
<p:inputMask mask="99/99/9999" id="birthdayEdit" value="#{employeeEditController.employee.birthday}" />
<p:outputLabel for="locationEdit" value="Wohnort: " />
<p:inputText id="locationEdit" value="#{employeeEditController.employee.location}" />
<p:outputLabel for="streetEdit" value="Straße: " />
<p:inputText id="streetEdit" value="#{employeeEditController.employee.streetName}" />
<p:outputLabel for="postcodeEdit" value="Postleitzahl: " />
<p:inputMask id="postcodeEdit" mask="9999?9" slotChar=" " value="#{employeeEditController.employee.postcode}" />
<p:outputLabel for="phonenumberEdit" value="Telefonnummer: " />
<p:inputMask id="phonenumberEdit" mask="9?99999999999" slotChar=" " maxlength="12" value="#{employeeEditController.employee.phoneNumber}" />
<p:outputLabel for="emailEdit" value="Email: " />
<p:inputText id="emailEdit" validatorMessage="Ungültiges Email-Format!" value="#{employeeEditController.employee.email}">
<f:validateRegex pattern="^$|^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*#[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$" />
</p:inputText>
</h:panelGrid>
<p:separator/>
<h:panelGrid columns="6">
<p:outputLabel for="familyStatus" value="Familienstatus: " />
<p:selectOneMenu id="familyStatus" value="#{employeeEditController.employee.familyStatus}" style="width:150px">
<f:selectItem itemLabel="Wähle Familienstatus" itemValue="#{employeeEditController.employee.familyStatus}" />
<f:selectItems value="#{enumController.familyStatus}" />
</p:selectOneMenu>
<p:outputLabel for="Religion" value="Religion: " />
<p:selectOneMenu id="Religion" value="#{employeeEditController.employee.religion}" style="width:150px">
<f:selectItem itemLabel="Wähle Religion" itemValue="#{employeeEditController.employee.religion}" />
<f:selectItems value="#{enumController.religions}" />
</p:selectOneMenu>
<p:outputLabel for="Role" value="Rolle: " />
<p:selectOneMenu id="Role" value="#{employeeEditController.employee.workRole}" style="width:150px">
<f:selectItem itemLabel="Wähle Arbeitsrolle" itemValue="#{employeeEditController.employee.workRole}" />
<f:selectItems value="#{enumController.workRoles}" />
</p:selectOneMenu>
</h:panelGrid>
<p:separator/>
<h:panelGrid columns="3">
<p:commandButton value="Speichern" action="#{employeeEditController.doSaveEmployeeEdit()}" />
<p:commandButton value="Neu laden" action="#{employeeEditController.doReloadEmployee()}" />
<p:commandButton value="Abbruch" onclick="PF('employeeEditDialog').hide()" />
</h:panelGrid>
</p:outputPanel>
</p:dialog>
</h:form>
What can be the reason that html or whatever still do the validation and don't call the doSaveEmployeeEdit()?
UPDATE:
I made a new xhtml-file with same outputs - no validation anymore. But my controller method doesn't get called.
My children.xhtml:
<h:body>
<body class="theme-blue sidebar-mini sidebar-collapse">
<div class="wrapper">
<div class="content-wrapper" style="min-height: 1126px;">
<section class="content">
<div class="box">
<div class="box-body">
<h:form id="childForm">
<p:dataTable id="childTable" var="child" value="#{childController.children}">
<p:column headerText="Vorname">
<h:outputText value="#{child.firstName}" />
</p:column>
<p:column headerText="Nachname">
<h:outputText value="#{child.lastName}" />
</p:column>
<p:column headerText="Geburtsdatum">
<h:outputText value="#{child.birthday}" />
</p:column>
<p:column style="width:32px;text-align: center">
<p:commandButton update=":childForm:childEdit" oncomplete="PF('childEditDialog').show()" icon="ui-icon-note" title="Bearbeiten">
<f:setPropertyActionListener value="#{child}" target="#{childEditController.childEdit}" />
</p:commandButton>
</p:column>
</p:dataTable>
<p:dialog header="Kind bearbeiten" widgetVar="childEditDialog" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
<p:messages autoUpdate="true" />
<p:outputPanel id="childEdit" style="text-align:center;">
<p:panelGrid columns="2" rendered="#{not empty childEditController.childEdit}" columnClasses="label,value">
<p:outputLabel id="primParent" value="primäres Elternteil:" />
<p:inputText for="primParent" value="#{childEditController.childEdit.primaryParent.id}" disabled="true" />
<p:outputLabel id="firstName" value="Vorname:" />
<p:inputText for="firstName" value="#{childEditController.childEdit.firstName}" />
<p:outputLabel id="lastName" value="Nachname:" />
<p:inputText for="lastName" value="#{childEditController.childEdit.lastName}" />
<p:outputLabel id="birthDay" value="Geburtsdatum:" />
<p:inputText for="birthDay" value="#{childEditController.childEdit.birthday}" />
<p:outputLabel id="emgNum" value="Notfallkontakt:" />
<p:inputText for="emgNum" value="#{childEditController.childEdit.emergencyNumber}" />
<p:outputLabel id="imgName" value="Bildname:" />
<p:inputText for="imgName" value="#{childEditController.childEdit.imgName}" />
<p:outputLabel for="gender" value="Geschlecht: " />
<p:inputText id="gender" value="#{childEditController.childEdit.gender}" disabled="true" />
<p:separator />
<h:panelGrid columns="3">
<p:commandButton value="Speichern" action="#{childEditController.doSaveChild}" update=":childForm:childTable" />
<p:commandButton value="Abbruch" onclick="PF('childEditDialog').hide()" immediate="true" />
</h:panelGrid>
</p:panelGrid>
</p:outputPanel>
</p:dialog>
</h:form>
</div>
</div>
</section>
</div>
</div>
</body>
</h:body>
My childEditController:
#Component
#Scope("request")
public class ChildEditController {
#Autowired
private ChildService childService;
private Child childEdit;
public Child getChildEdit() {
return childEdit;
}
public void setChildEdit(Child childEdit) {
this.childEdit = childEdit;
}
public void doSaveChild(){
childEdit = childService.saveChild(childEdit);
childEdit = null;
}
}
I have the following xhtml:
<f:metadata>
<f:viewParam name="livroId" value="#{livroBean.livro.id}" />
<f:viewAction action="#{livroBean.carregarLivroPelaId}"
if="#{param.livroId != null}" />
</f:metadata>
<ui:define name="titulo">
<p:outputPanel>Novo Livro</p:outputPanel>
</ui:define>
<ui:define name="conteudo">
<h:form>
<p:messages id="messages" />
<p:fieldset legend="Dados do Livro">
<p:panelGrid columns="2">
<p:outputLabel value="Titulo:" for="titulo" />
<p:inputText id="titulo" value="#{livroBean.livro.titulo}"
required="true" requiredMessage="Título obrigatório"
validatorMessage="Título não pode ser superior a 40">
<f:validateLength maximum="40" />
<f:ajax event="blur" render="messages" />
</p:inputText>
<p:outputLabel value="ISBN:" for="isbn" />
<p:inputMask id="isbn" value="#{livroBean.livro.isbn}"
validator="#{livroBean.comecaComDigitoUm}"
mask="999-9-99-999999-9" />
<p:outputLabel value="Preço:" for="preco" />
<p:inputText id="preco" value="#{livroBean.livro.preco}" />
<p:outputLabel value="Data de Lançamento:" for="dataLancamento" />
<p:calendar id="dataLancamento"
value="#{livroBean.livro.dataLancamento.time}"
pattern="dd/MM/yyyy" timeZone="America/Sao_Paulo" mask="true" />
</p:panelGrid>
</p:fieldset>
<br />
<p:fieldset legend="Dados do Autor">
<p:panelGrid columns="4">
<p:outputLabel value="Selecione Autor:" for="autor" />
<p:selectOneMenu value="#{livroBean.autorId}" id="autor">
<f:selectItems value="#{livroBean.autores}" var="autor"
itemLabel="#{autor.nome}" itemValue="#{autor.id}" />
</p:selectOneMenu>
<p:commandButton value="Gravar Autor"
action="#{livroBean.gravarAutor}" process="#this autor"
update="tabelaAutores" />
<p:commandLink value="ou cadastrar novo autor"
action="#{livroBean.formAutor}" immediate="true" update="#all" />
</p:panelGrid>
<p:dataTable value="#{livroBean.autoresDoLivro}" var="autor"
id="tabelaAutores" emptyMessage="Nenhum autor">
<p:column>
<h:outputText value="#{autor.nome}" />
</p:column>
<p:column>
<p:commandLink value="X"
action="#{livroBean.removerAutorDoLivro(autor)}"
update="tabelaAutores" process="#this" />
</p:column>
</p:dataTable>
</p:fieldset>
<br />
<h:panelGrid style="margin: 0 auto">
<p:commandButton value="Gravar" action="#{livroBean.gravar}"
process="#form" update="#form :formTabelaLivros:tabelaLivros" />
</h:panelGrid>
</h:form>
<br />
<h:form id="formTabelaLivros">
<p:dataTable value="#{livroBean.livros}" var="livro"
id="tabelaLivros" paginator="true" rows="5">
<f:facet name="header">Livros</f:facet>
<p:column headerText="Título" sortBy="#{livro.titulo}"
filterBy="#{livro.titulo}" filterMatchMode="startsWith">
<h:outputText value="#{livro.titulo}" />
</p:column>
<p:column headerText="ISBN" sortBy="#{livro.isbn}">
<h:outputText value="#{livro.isbn}" />
</p:column>
<p:column headerText="Preço" sortBy="#{livro.preco}">
<h:outputText value="#{livro.preco}">
<f:convertNumber type="currency" pattern="R$ #0.00"
currencySymbol="R$" locale="pt_BR" />
</h:outputText>
</p:column>
<p:column headerText="Data" sortBy="#{livro.dataLancamento.time}">
<h:outputText value="#{livro.dataLancamento.time}">
<f:convertDateTime pattern="dd/MM/yyyy"
timeZone="America/Sao_Paulo" />
</h:outputText>
</p:column>
<p:column headerText="Alterar">
<h:commandLink value="Alterar" action="#{livroBean.carregar(livro)}" />
</p:column>
<p:column headerText="Remover">
<h:commandLink value="Remover" action="#{livroBean.remover(livro)}" />
</p:column>
</p:dataTable>
</h:form>
</ui:define>
The h:commandLink "Remover" is actually removing the object from my database, but is not updating the DataTable. I've already set process="#form" update="#form", but it doesn't help.
It was actually working fine before, and it suddenly stopped (I didn't modify anything related to my bean).
EDIT:
I changed it to a CommandButton, as below:
<p:column headerText="Remover">
<p:commandButton icon="fa fa-fw fa-remove" actionListener="#{livroBean.remover(livro)}" process="#form" update="#form" />
</p:column>
But still no results... The button works, it removes the entry from my database, but it does not updates the datatable. Tried with action= as well.
In the JSF page for updating some entity, a dropdown is used to select the desired row:
Then all fields are filled with the selected row information, except the dropdowns:
I created two methods, one for loading each dropdown, in the entity's managed bean. For the first one I used the following code:
public List<Rede> getRedes() {
if (this.redes == null) {
redes = redeBean.findWithNamedQuery("Rede.findAll");
}
if (this.estabelecimento.getId() > 0) {
Map<String, Object> map = new HashMap<>();
map.put("estabelecimento_id", this.estabelecimento.getId());
this.rede = (Rede) redeBean.findWithNamedQuery("Rede.findByEstabelecimentoId", map).get(0);
for (Rede r : redes) {
if(Objects.equals(this.rede.getId(), r.getId())) {
this.rede = r;
}
}
}
return redes;
}
But estabelecimento.getId() throws NullPointerException, but estabelecimento is not null. Estabelecimento is instantiated in the PostConstruct method.
The alterar.xhtml page:
<ui:define name="content">
<f:metadata>
<f:viewParam name="id" value="#{estabelecimentoMB.estabelecimento.id}" />
<f:viewParam name="redeId" value="#{estabelecimentoMB.rede.id}" />
<f:viewParam name="categoriaId" value="#{estabelecimentoMB.categoria.id}" />
</f:metadata>
<h:form id="form" enctype="multipart/form-data">
<p:growl id="growl" showDetail="true" sticky="true" globalOnly="true" />
<p:panelGrid id="pnl" columns="2">
<p:outputLabel for="estabelecimentos" value="Estabelecimento:" />
<p:selectOneMenu id="estabelecimentos" value="#{estabelecimentoMB.estabelecimento.id}" >
<f:selectItem itemValue="0" itemLabel="-- Selecione --" />
<f:selectItems value="#{estabelecimentoMB.estabelecimentos}" var="x" itemValue="#{x.id}" itemLabel="#{x.nomefantasia}" />
<p:ajax event="change" listener="#{estabelecimentoMB.prepareEdit(estabelecimentoMB.estabelecimento.id)}" update="#form" />
</p:selectOneMenu>
<p:message for="estabelecimentos" />
</p:panelGrid>
<p:separator />
<p:panelGrid id="pnl-info" columns="3">
<p:outputLabel for="cnpj" value="CNPJ:" />
<p:inputText id="cnpj" required="true" value="#{estabelecimentoMB.estabelecimento.cnpj}" />
<p:message for="cnpj" />
<p:outputLabel for="razaosocial" value="Razão Social:" />
<p:inputText id="razaosocial" required="true" value="#{estabelecimentoMB.estabelecimento.razaosocial}" />
<p:message for="razaosocial" />
<p:outputLabel for="nomefantasia" value="Nome Fantasia:" />
<p:inputText id="nomefantasia" required="true" value="#{estabelecimentoMB.estabelecimento.nomefantasia}" />
<p:message for="nomefantasia" />
<p:outputLabel for="cep" value="CEP:" />
<p:inputText id="cep" required="true" value="#{estabelecimentoMB.estabelecimento.cep}" />
<p:message for="cep" />
<p:outputLabel for="logradouro" value="Logradouro:" />
<p:inputText id="logradouro" required="true" value="#{estabelecimentoMB.estabelecimento.logradouro}" />
<p:message for="logradouro" />
<p:outputLabel for="numero" value="Número:" />
<p:inputText id="numero" required="true" value="#{estabelecimentoMB.estabelecimento.numero}" />
<p:message for="numero" />
<p:outputLabel for="razaosocial" value="Razão Social:" />
<p:inputText id="complemento" required="true" value="#{estabelecimentoMB.estabelecimento.razaosocial}" />
<p:message for="razaosocial" />
<p:outputLabel for="bairro" value="Bairro:" />
<p:inputText id="bairro" required="true" value="#{estabelecimentoMB.estabelecimento.bairro}" />
<p:message for="bairro" />
<p:outputLabel for="cidade" value="Cidade:" />
<p:inputText id="cidade" required="true" value="#{estabelecimentoMB.estabelecimento.cidade}" />
<p:message for="cidade" />
<p:outputLabel for="estado" value="Estado:" />
<p:inputText id="estado" required="true" value="#{estabelecimentoMB.estabelecimento.estado}" />
<p:message for="estado" />
<p:outputLabel for="pais" value="País:" />
<p:inputText id="pais" required="true" value="#{estabelecimentoMB.estabelecimento.pais}" />
<p:message for="pais" />
<p:outputLabel for="telefone" value="Telefone:" />
<p:inputText id="telefone" required="true" value="#{estabelecimentoMB.estabelecimento.telefone}" />
<p:message for="telefone" />
<p:outputLabel for="contato" value="Contato:" />
<p:inputText id="contato" required="true" value="#{estabelecimentoMB.estabelecimento.contato}" />
<p:message for="contato" />
<p:outputLabel for="email" value="E-mail:" />
<p:inputText id="email" required="true" value="#{estabelecimentoMB.estabelecimento.email}" />
<p:message for="email" />
<p:outputLabel for="site" value="Site:" />
<p:inputText id="site" required="true" value="#{estabelecimentoMB.estabelecimento.site}" />
<p:message for="site" />
<p:outputLabel for="latitude" value="Latitude:" />
<p:inputText id="latitude" value="#{estabelecimentoMB.estabelecimento.latitude}" />
<p:message for="latitude" />
<p:outputLabel for="longitude" value="Longitude:" />
<p:inputText id="longitude" value="#{estabelecimentoMB.estabelecimento.longitude}" />
<p:message for="longitude" />
<p:outputLabel for="redes" value="Rede:" />
<p:selectOneMenu id="redes" value="#{estabelecimentoMB.rede.id}" >
<f:selectItem itemLabel="-- Selecione --" itemValue="0" />
<f:selectItems itemLabel="#{rede.nomefantasia}" itemValue="#{rede.id}" value="#{redeMB.redes}" var="rede" />
</p:selectOneMenu>
<p:message for="redes" />
<p:outputLabel for="categorias" value="Categoria:" />
<p:selectOneMenu id="categorias" value="#{estabelecimentoMB.categoria.id}" >
<f:selectItem itemLabel="-- Selecione --" itemValue="0" />
<f:selectItems itemLabel="#{categoria.nome}" itemValue="#{categoria.id}" value="#{categoriaEstabelecimentoMB.categorias}" var="categoria" />
</p:selectOneMenu>
<p:message for="categorias" />
<p:commandButton action="#{estabelecimentoMB.save}" value="Salvar" update="#form" />
</p:panelGrid>
</h:form>
</ui:define>
The prepareEdit method has only this line: this.estabelecimento = this.estabelecimentoBean.findById(id);
EstabelecimentoMB is ViewScoped.
Added noSelectionOption="true" to both dropdowns;
Changed the prepareEdit method to:
public void prepareEdit(int id) {
Map<String, Object> map = new HashMap<>();
map.put("estabelecimento_id", id);
this.estabelecimento = this.estabelecimentoBean.findById(id);
this.rede = (Rede) this.redeBean.findWithNamedQuery("Rede.findByEstabelecimentoId", map).get(0);
this.categoria = (CategoriaEstabelecimento) this.categoriaBean.findWithNamedQuery("CategoriaEstabelecimento.findByEstabelecimentoId", map).get(0);
}
It's working now.
I tried to update a Gmap which placed in a tabView. But i am getting the
java.lang.IllegalArgumentException: tab2
error. I have searched this problem a little and noticed that it is available only if tab is visible. So what can I do ? The code block is below:
<h:form id="form">
<p:tabView orientation="left" id="tabView" styleClass="tabView">
<p:ajax event="tabChange" listener="#{sucBean.onTabChange}"
update=":form:tabView:map" />
<p:tab title="Bütün Suçlar" id="tab1">
<p:gmap zoom="10" type="HYBRID" center="40.78470,29.94873" id="map"
model="#{sucBean.advancedModel}"
style="width:740px;height:500px;margin:-14px 0 0 -10px;">
<p:ajax event="overlaySelect" listener="#{sucBean.onMarkerSelect}" />
<p:gmapInfoWindow>
<p:outputPanel
style="text-align:justify;display:block;margin:auto:">
<p:panelGrid columns="2" cellpadding="8">
<h:outputText value="Suç Tipi:" style="color:red" />
<h:outputText value="#{sucBean.marker.data.sucTipi}" />
<h:outputText value="Tarih: " style="color:red" />
<h:outputText value="#{sucBean.marker.data.islenmeZamani}" />
<h:outputText value="Adres: " style="color:red" />
<h:outputText value="#{sucBean.marker.data.adres}" />
<h:outputText value="Suçu İşleyen:" style="color:red" />
<h:outputText value="#{sucBean.marker.data.isleyenBilgisi}" />
</p:panelGrid>
</p:outputPanel>
</p:gmapInfoWindow>
</p:gmap>
</p:tab>
<p:tab title="Suç Ara" id="tab2">
<p:fieldset legend="Ayrıntılı Arama" styleClass="searchField"
id="fieldSet">
<p:panelGrid columns="4" cellpadding="10">
<p:inputText value="#{sucBean.arananKelime}" style="width:300px" />
<h:outputText value=" Kriter:" />
<p:selectOneMenu value="#{sucBean.aramaKriteri}">
<f:selectItem itemLabel="Suç Tipi" itemValue="sucTipi" />
<f:selectItem itemLabel="Adres" itemValue="adres" />
<f:selectItem itemLabel="İşlenme Zamanı" itemValue="zaman" />
<f:selectItem itemLabel="Cinsiyet" itemValue="cinsiyet" />
<f:selectItem itemLabel="Yaş" itemValue="yas" />
</p:selectOneMenu>
<p:commandButton value="Ara"
actionListener="#{sucBean.sucKaydiAra}" update="aramaSonucu" />
</p:panelGrid>
</p:fieldset>
<p:dataTable var="suc" value="#{sucBean.sucModel}" paginator="true"
rows="10" id="aramaSonucu" selection="#{sucBean.selectedSuc}">
<p:column selectionMode="multiple" style="width:18px"></p:column>
<p:column headerText="Suç Tipi">
<h:outputText value="#{suc.sucTipi}" />
</p:column>
<p:column headerText="İşlenme Zamanı">
<h:outputText value="#{suc.islenmeZamani}" />
</p:column>
<p:column headerText="Adres">
<h:outputText value="#{suc.adres}" />
</p:column>
<p:column headerText="Suçu İşleyen">
<h:outputText value="#{suc.isleyenBilgisi}" />
</p:column>
<!-- <f:facet name="footer"> -->
<!-- </f:facet> -->
</p:dataTable>
<p:commandButton id="multiSelectButton" actionListener="#{sucBean.secilenleriGetir}" update=":form:tabView:tab2:map2"
value="Secilenleri Haritada Göster" icon="ui-icon-pin-s" />
<p:gmap zoom="12" type="HYBRID" center="40.78470,29.94873"
id="map2" model="#{sucBean.advancedModel2}"
style="width:740px;height:300px;margin:10px 0 0 -10px;">
When you reference a component inside container components like tabView or accordion, you don't need to include the actual tab id in your update target.
In your case update=":form:tabView:map2" would be the correct update target.