Does anyone knows how to disable the sourceCaption from primefaces picklist template?
I need that my user set three informations
(crudMB.upf.dataImplantacao, crudMB.upf.responsavelImplantacao, crudMB.upf.prazoSenha ) before selecting any options at the picklist.
At my code you guys can see this three variables that i need to enable the source part of the picklist.
<p:panel header="Produtos Fornecidos" style="height: auto;">
<h:panelGrid columns="2">
<h:outputLabel value="Data Implantação:" />
<p:calendar value="#{crudMB.upf.dataImplantacao}" />
<h:outputLabel value="Responsavel Implantação: " />
<p:inputText value="#{crudMB.upf.responsavelImplantacao}" />
<h:outputLabel value="Prazo de Senha: " />
<p:selectOneMenu value="#{crudMB.upf.prazoSenha}" >
<f:selectItem itemLabel="Selecione Um" itemValue="" itemDisabled="true" />
<f:selectItems value="#{crudMB.prazosSenha}" var="ps" itemLabel="#{ps.descricao}" />
</p:selectOneMenu>
</h:panelGrid>
<h:panelGrid>
<p:pickList id="picklist" value="#{crudMB.produtosFornecidos}" var="pf" itemValue="#{pf}" itemLabel="#{pf.nome}" converter="genericPickListConverter" >
<f:facet name="sourceCaption" >Disponiveis</f:facet>
<f:facet name="targetCaption" >Escolhidos</f:facet>
<p:ajax event="transfer" listener="#{crudMB.onTransfer}" />
<p:column>
<p:outputLabel value="#{pf.nome}"/>
</p:column>
<p:column>
<p:outputLabel value="#{pf.plataforma}"/>
</p:column>
<p:column>
<p:outputLabel value="#{pf.versaoAtual}"/>
</p:column>
</p:pickList>
</h:panelGrid>
Related
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.
I am trying to update the selected row (object) in <p:dataTable> when user clicks on the context menu but the object bound to <p:dataTable> selection="" doesn't updates according to row selection/context menu click, the debugging showed that the object's attributes in the bean doesn't contain any updated values but empty.
The code is:
<h:form id="searchStdentsFrm">
<p:dialog id="searchStdentsDlg" header="Search Students" widgetVar="srchStdents" modal="true">
<p:contextMenu for="srchStdentsTble" id="menuStdEdit">
<p:menuitem value="Change Status" update="stdDetail" icon="ui-icon-flag" oncomplete="PF('editStudentDialog').show()" />
<p:menuitem value="Edit Student" update="stdStatusDetail" icon="ui-icon-wrench" oncomplete="PF('editStudentStatusDialog').show()" action="#{viewStudentsBean.testAction}"/>
</p:contextMenu>
<p:dataTable id="srchStdentsTble" var="student" value="#{viewStudentsBean.studentsList}"
rowKey="#{student.id}" selection="#{viewStudentsBean.selectedStudent}"
selectionMode="single" widgetVar="srchStdentTbl"
emptyMessage="No students found with the given criteria" filteredValue="#{viewStudentsBean.filteredStudents}">
<p:ajax event="contextMenu"/>
<f:facet name="header">
<p:outputPanel>
<h:outputText value="Search Students:" />
<p:inputText id="globalFilter" onkeyup="PF('srchStdentTbl').filter()" style="width:200px" placeholder="Enter keyword"/>
</p:outputPanel>
</f:facet>
<p:column id="stdentId" headerText="Id" filterBy="#{student.id}" filterStyle="display:none">
<h:outputText value="#{student.id}" />
</p:column>
<p:column id="stdentFirstName" headerText="Firstname" filterBy="#{student.firstName}" filterStyle="display:none">
<h:outputText value="#{student.firstName}" />
</p:column>
<p:column id="stdentLastname" headerText="Lastname" filterBy="#{student.lastName}" filterStyle="display:none">
<h:outputText value="#{student.lastName}" />
</p:column>
<p:column id="stdentFathername" headerText="Father name" filterBy="#{student.fatherName}" filterStyle="display:none">
<h:outputText value="#{student.fatherName}" />
</p:column>
<p:column id="stdentGender" headerText="Gender" filterBy="#{student.gender}" filterStyle="display:none">
<h:outputText value="#{student.gender}" />
</p:column>
<p:column id="stdentDOB" headerText="Date Of birth" filterBy="#{student.dob}" filterStyle="display:none">
<h:outputText value="#{student.dob}" />
</p:column>
<p:column id="stdentSkype" headerText="Skype/Email" filterBy="#{student.skypeOrEmailId}" filterStyle="display:none">
<h:outputText value="#{student.skypeOrEmailId}" />
</p:column>
<p:column id="stdentPhone" headerText="Phone No" filterBy="#{student.phoneNumber}" filterStyle="display:none">
<h:outputText value="#{student.phoneNumber}" />
</p:column>
<p:column id="stdentAddrs" headerText="Address" filterBy="#{student.address}" filterStyle="display:none">
<h:outputText value="#{student.address}" />
</p:column>
<p:column id="stdentCountry" headerText="Country" filterBy="#{student.country}" filterStyle="display:none">
<h:outputText value="#{student.country}" />
</p:column>
<p:column id="stdentJOD" headerText="Joining Date" filterBy="#{student.dateOfJoining}" filterStyle="display:none">
<h:outputText value="#{student.dateOfJoining}" />
</p:column>
<p:column id="stdentGenralRmrks" headerText="General Remarks" filterBy="#{student.generalRemarks}" filterStyle="display:none">
<h:outputText value="#{student.generalRemarks}" />
</p:column>
<p:column id="studentStatus" headerText="Student Status" filterBy="#{student.studentStatus}" filterStyle="display:none">
<h:outputText value="#{student.studentStatus}" />
</p:column>
</p:dataTable>
</p:dialog>
<p:dialog id="editStdentDlg" header="Edit Student" widgetVar="editStudentDialog" modal="true">
<p:outputPanel id="stdDetail" style="text-align:center;">
<p:outputLabel value="First Name *" />
<p:inputText value="#{viewStudentsBean.selectedStudent.lastName}"/>
<p:panelGrid id="editStdPanelGrd" columns="2" cellpadding="5" style="width: 100%;">
<p:outputLabel value="First Name *" />
<p:inputText id="stdEditFname" value="#{viewStudentsBean.selectedStudent.firstName}"/>
<p:outputLabel value="Last Name *" />
<p:inputText id="stdEditLastname" value="#{viewStudentsBean.selectedStudent.lastName}"/>
<p:outputLabel value="Father's Name *" />
<p:inputText id="stdEditFathName" value="#{viewStudentsBean.selectedStudent.fatherName}"/>
<p:outputLabel value="Gender *" />
<h:selectOneMenu id="stdEditGnder" value="#{viewStudentsBean.selectedStudent.gender}">
<f:selectItem itemValue="Male" itemLabel="Male" />
<f:selectItem itemValue="Female" itemLabel="Female" />
</h:selectOneMenu>
<p:outputLabel value="Date Of Birth *" />
<p:calendar id="stdEditDOB" value="#{viewStudentsBean.selectedStudent.dob}"/>
<p:outputLabel value="Skype Id/Email *" />
<p:inputText id="stdEditSkype" value="#{viewStudentsBean.selectedStudent.skypeOrEmailId}"/>
<p:outputLabel value="Phone No *" />
<p:inputText id="stdEditPNo" value="#{viewStudentsBean.selectedStudent.phoneNumber}"/>
<p:outputLabel value="Address *" />
<p:inputText id="stdEditAddrs" value="#{viewStudentsBean.selectedStudent.address}"/>
<p:outputLabel value="Country *" />
<p:inputText id="stdEditCountry" value="#{viewStudentsBean.selectedStudent.country}"/>
<p:outputLabel value="Date of joining *" />
<p:calendar id="stdEditDOJ" value="#{viewStudentsBean.selectedStudent.dateOfJoining}"/>
<p:outputLabel value="General Remarks" />
<p:inputText id="stdEditGR" value="#{viewStudentsBean.selectedStudent.generalRemarks}"/>
</p:panelGrid>
</p:outputPanel>
</p:dialog>
<p:dialog id="editStdentStatusDlg" header="Edit Student" widgetVar="editStudentStatusDialog" modal="true">
<p:outputPanel id="stdStatusDetail" style="text-align:center;">
The current status of:<p:outputLabel value="#{viewStudentsBean.selectedStudent.lastName}"/>
is: <p:outputLabel value="#{viewStudentsBean.selectedStudent.studentStatus}" />
</p:outputPanel>
</p:dialog>
</h:form>
PS: I am using JSF 2.2 with PrimeFaces 5.0
I am absolutely stuck here. Any help would be greatly appreciated
Found the solution. Actually the second dialog in which i wanted to display/edit the selection object binded to p:datatable, required to be updated in context menu like:
update=":searchStdentsForm:editStdentDlg"
means the form and dialog needed to be explicitly referred.
I'm working with a <p:overlayPanel> that includes a couple of <p:selectOneMenu>s, as well as several other components. When the <p:selectOneMenu>s are opened, some of the fields fall outside of the <p:overlayPanel>, and clicking on them causes the panel to close. (See image below).
.
.
.
One solution would be to modify the <p:overlayPanel> as follows:
dismissable="false"
showCloseIcon="true"
Another would be to modify the <p:selectOneMenu>:
height="50"
I'm looking for some options for solutions that are as simple as possible and preferably don't involve a change to the UI (the above solutions both change the UI). Is there a way to keep the <p:overlayPanel> open when a click outside of it falls within one of its <p:selectMenu>s?
More Complete Code
<p:overlayPanel styleClass="col-settings-panel"
id="colSettingsPanel"
for="columnSettingsBtn"
hideEffect="fade"
widgetVar="wvcolSettingsPanel"
rendered="#{empty rendered ? 'true' : rendered}" >
<p:pickList id="pickList"
value="#{fileSearchPersonalizationBean.columns}"
var="column"
showSourceFilter="true"
itemLabel="#{column}"
itemValue="#{column}"
itemDisabled="#{column eq 'Ref No'}">
<p:ajax event="transfer" listener="#{fileSearchPersonalizationBean.onTransfer}" update="pickList availableCount selectedCount selectSortBy" />
<f:facet name="sourceCaption">
<h:outputText value="Available Columns ("/>
<h:outputText id="availableCount" value="#{fileSearchPersonalizationBean.sourceCount}"/>
<h:outputText value=")"/>
</f:facet>
<f:facet name="targetCaption">
<h:outputText value="Selected Columns ("/>
<h:outputText id="selectedCount" value="#{fileSearchPersonalizationBean.targetCount}"/>
<h:outputText value=")"/>
</f:facet>
</p:pickList>
<p:panelGrid columns="1">
<p:outputPanel styleClass="col-settings-panel-option">
<h:outputLabel value="Sort By: " />
<p:selectOneMenu id="selectSortBy"
value="#{fileSearchPersonalizationBean.sortBy}" >
<p:ajax listener="#{fileSearchPersonalizationBean.sortByChanged}" />
<f:selectItems id="sortByList" value="#{fileSearchPersonalizationBean.columns.target}" />
</p:selectOneMenu>
</p:outputPanel>
<p:outputPanel styleClass="col-settings-panel-option">
<h:outputLabel value="Items per Page:"/>
<p:selectOneMenu id="selectRows" value="#{fileSearchPersonalizationBean.sRows}" >
<f:selectItem itemLabel="10" itemValue="10" />
<f:selectItem itemLabel="25" itemValue="25" />
<f:selectItem itemLabel="50" itemValue="50" />
<f:selectItem itemLabel="100" itemValue="100" />
</p:selectOneMenu>
</p:outputPanel>
</p:panelGrid>
<p:panelGrid styleClass="toolbar" columns="2">
<p:outputPanel>
<p:commandButton styleClass="btn-secondary"
id="loadDefaults"
value="Reset Defaults"
update="selectSortBy pickList selectRows"
actionListener="#{fileSearchPersonalizationBean.loadDefaultVO}" />
</p:outputPanel>
<p:outputPanel styleClass="toolbar-right">
<p:commandButton styleClass="btn-secondary"
id="columnClose"
value="Cancel"
actionListener="#{fileSearchPersonalizationBean.panelCancel}"
immediate="false">
<f:attribute name="panelId" value="#{formId}:colSettingsPanel" />
</p:commandButton>
<p:commandButton styleClass="btn-primary"
id="columnSubmit"
value="Save & Apply"
actionListener="#{fileSearchPersonalizationBean.panelSave}"
oncomplete="refreshSearchResults();" >
<f:attribute name="panelId" value="#{formId}:colSettingsPanel" />
</p:commandButton>
</p:outputPanel>
</p:panelGrid>
</p:overlayPanel>`
Ok, this issue is driving me nuts....
I've got this xhtml page, with 2 dialogs...
both dialogs has a form inside to send a submit to the server, they work fine, but when they are called and updated from a commandLink form, actionListener from dialog form just doesn't work, any ideas?
this is the menu where I call the dialogs
<ui:define name="left">
<h:form id="menuForm">
<div class="sidebar-nav">
<div class="well" style="width:150px; padding: 8px 0;">
<ul class="nav nav-list">
<li class="text-center">Options</li>
<li><p:commandLink id="createLink" update=":LocationCreateForm" actionListener="#{locationController.prepareCreate}" oncomplete="LocationCreateDialog.show()"><span class="glyphicon glyphicon-user"></span> Create New</p:commandLink> </li>
<li><p:commandLink id="editLink" update=":LocationEditForm" oncomplete="LocationEditDialog.show()"><span class="glyphicon glyphicon-edit"></span> Update</p:commandLink> </li>
<li><p:commandLink id="deleteLink" actionListener="#{locationController.delete}"><span class="glyphicon glyphicon-ban-circle"></span> Delete</p:commandLink> </li>
</ul>
</div>
</div>
</h:form>
</ui:define>
if I remove the update from commandLink they work, but for edit dialog I can't get the information to edit.
where the dialogs and list are:
<ui:define name="content">
<h1>Locations</h1>
<!-- Location List -->
<h:form id="LocationListForm">
<p:dataTable id="datalist" value="#{locationController.items}" var="item"
selectionMode="single" selection="#{locationController.selected}"
rowKey="#{item.id}"
>
<p:column sortBy="#{item.id}" filterBy="#{item.id}">
<f:facet name="header">
<h:outputText value="#{myBundle.ListLocationTitle_id}"/>
</f:facet>
<h:outputText value="#{item.id}"/>
</p:column>
<p:column sortBy="#{item.name}" filterBy="#{item.name}">
<f:facet name="header">
<h:outputText value="#{myBundle.ListLocationTitle_name}"/>
</f:facet>
<h:outputText value="#{item.name}"/>
</p:column>
<p:column sortBy="#{item.openingHourMonday}" filterBy="#{item.openingHourMonday}">
<f:facet name="header">
<h:outputText value="#{myBundle.ListLocationTitle_openingHourMonday}"/>
</f:facet>
<h:outputText value="#{item.openingHourMonday}">
<f:convertDateTime pattern="HH:mm:ss" />
</h:outputText>
</p:column>
<p:column sortBy="#{item.openingHourTuesday}" filterBy="#{item.openingHourTuesday}">
<f:facet name="header">
<h:outputText value="#{myBundle.ListLocationTitle_openingHourTuesday}"/>
</f:facet>
<h:outputText value="#{item.openingHourTuesday}">
<f:convertDateTime pattern="HH:mm:ss" />
</h:outputText>
</p:column>
<p:column sortBy="#{item.openingHourWednesday}" filterBy="#{item.openingHourWednesday}">
<f:facet name="header">
<h:outputText value="#{myBundle.ListLocationTitle_openingHourWednesday}"/>
</f:facet>
<h:outputText value="#{item.openingHourWednesday}">
<f:convertDateTime pattern="HH:mm:ss" />
</h:outputText>
</p:column>
<p:column sortBy="#{item.openingHourThrusday}" filterBy="#{item.openingHourThrusday}">
<f:facet name="header">
<h:outputText value="#{myBundle.ListLocationTitle_openingHourThrusday}"/>
</f:facet>
<h:outputText value="#{item.openingHourThrusday}">
<f:convertDateTime pattern="HH:mm:ss" />
</h:outputText>
</p:column>
<p:column sortBy="#{item.openingHourFriday}" filterBy="#{item.openingHourFriday}">
<f:facet name="header">
<h:outputText value="#{myBundle.ListLocationTitle_openingHourFriday}"/>
</f:facet>
<h:outputText value="#{item.openingHourFriday}">
<f:convertDateTime pattern="HH:mm:ss" />
</h:outputText>
</p:column>
<p:column sortBy="#{item.openingHourSaturday}" filterBy="#{item.openingHourSaturday}">
<f:facet name="header">
<h:outputText value="#{myBundle.ListLocationTitle_openingHourSaturday}"/>
</f:facet>
<h:outputText value="#{item.openingHourSaturday}">
<f:convertDateTime pattern="HH:mm:ss" />
</h:outputText>
</p:column>
<p:column sortBy="#{item.openingHourSunday}" filterBy="#{item.openingHourSunday}">
<f:facet name="header">
<h:outputText value="#{myBundle.ListLocationTitle_openingHourSunday}"/>
</f:facet>
<h:outputText value="#{item.openingHourSunday}">
<f:convertDateTime pattern="HH:mm:ss" />
</h:outputText>
</p:column>
</p:dataTable>
</h:form>
<!-- Location Create Dialog -->
<p:dialog id="LocationCreateDlg" widgetVar="LocationCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{myBundle.CreateLocationTitle}">
<h:form id="LocationCreateForm">
<h:panelGroup id="display">
<p:panelGrid columns="2" >
<p:outputLabel value="#{myBundle.CreateLocationLabel_name}" for="name" />
<p:inputText id="name" value="#{locationController.selected.name}" title="#{myBundle.CreateLocationTitle_name}" required="true" requiredMessage="#{myBundle.CreateLocationRequiredMessage_name}"/>
<p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourMonday}" for="openingHourMonday" />
<p:calendar id="openingHourMonday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourMonday}" title="#{myBundle.EditLocationTitle_openingHourMonday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourMonday}" showOn="button"/>
<p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourTuesday}" for="openingHourTuesday" />
<p:calendar id="openingHourTuesday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourTuesday}" title="#{myBundle.EditLocationTitle_openingHourTuesday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourTuesday}" showOn="button"/>
<p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourWednesday}" for="openingHourWednesday" />
<p:calendar id="openingHourWednesday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourWednesday}" title="#{myBundle.EditLocationTitle_openingHourWednesday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourWednesday}" showOn="button"/>
<p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourThrusday}" for="openingHourThrusday" />
<p:calendar id="openingHourThrusday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourThrusday}" title="#{myBundle.EditLocationTitle_openingHourThrusday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourThrusday}" showOn="button"/>
<p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourFriday}" for="openingHourFriday" />
<p:calendar id="openingHourFriday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourFriday}" title="#{myBundle.EditLocationTitle_openingHourFriday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourFriday}" showOn="button"/>
<p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourSaturday}" for="openingHourSaturday" />
<p:calendar id="openingHourSaturday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourSaturday}" title="#{myBundle.EditLocationTitle_openingHourSaturday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourSaturday}" showOn="button"/>
<p:outputLabel value="#{myBundle.CreateLocationLabel_openingHourSunday}" for="openingHourSunday" />
<p:calendar id="openingHourSunday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourSunday}" title="#{myBundle.EditLocationTitle_openingHourSunday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourSunday}" showOn="button"/>
</p:panelGrid>
<p:commandButton actionListener="#{locationController.saveNew}" value="#{myBundle.Save}" update="display,:LocationListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,LocationCreateDialog);"/>
<p:commandButton value="#{myBundle.Cancel}" onclick="LocationCreateDialog.hide();"/>
</h:panelGroup>
</h:form>
</p:dialog>
<!-- Location Update Dialog -->
<p:dialog id="LocationEditDlg" widgetVar="LocationEditDialog" modal="true" resizable="false" appendToBody="true" header="#{myBundle.EditLocationTitle}">
<h:form id="LocationEditForm">
<h:panelGroup id="display">
<p:panelGrid columns="2" rendered="#{locationController.selected != null}">
<h:outputLabel value="#{myBundle.EditLocationLabel_id}" for="id" />
<h:outputText id="id" value="#{locationController.selected.id}" />
<p:outputLabel value="#{myBundle.EditLocationLabel_name}" for="name" />
<p:inputText id="name" value="#{locationController.selected.name}" title="#{myBundle.EditLocationTitle_name}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_name}"/>
<p:outputLabel value="#{myBundle.EditLocationLabel_openingHourMonday}" for="openingHourMonday" />
<p:calendar id="openingHourMonday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourMonday}" title="#{myBundle.EditLocationTitle_openingHourMonday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourMonday}" showOn="button"/>
<p:outputLabel value="#{myBundle.EditLocationLabel_openingHourTuesday}" for="openingHourTuesday" />
<p:calendar id="openingHourTuesday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourTuesday}" title="#{myBundle.EditLocationTitle_openingHourTuesday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourTuesday}" showOn="button"/>
<p:outputLabel value="#{myBundle.EditLocationLabel_openingHourWednesday}" for="openingHourWednesday" />
<p:calendar id="openingHourWednesday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourWednesday}" title="#{myBundle.EditLocationTitle_openingHourWednesday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourWednesday}" showOn="button"/>
<p:outputLabel value="#{myBundle.EditLocationLabel_openingHourThrusday}" for="openingHourThrusday" />
<p:calendar id="openingHourThrusday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourThrusday}" title="#{myBundle.EditLocationTitle_openingHourThrusday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourThrusday}" showOn="button"/>
<p:outputLabel value="#{myBundle.EditLocationLabel_openingHourFriday}" for="openingHourFriday" />
<p:calendar id="openingHourFriday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourFriday}" title="#{myBundle.EditLocationTitle_openingHourFriday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourFriday}" showOn="button"/>
<p:outputLabel value="#{myBundle.EditLocationLabel_openingHourSaturday}" for="openingHourSaturday" />
<p:calendar id="openingHourSaturday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourSaturday}" title="#{myBundle.EditLocationTitle_openingHourSaturday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourSaturday}" showOn="button"/>
<p:outputLabel value="#{myBundle.EditLocationLabel_openingHourSunday}" for="openingHourSunday" />
<p:calendar id="openingHourSunday" pattern="HH:mm:ss" value="#{locationController.selected.openingHourSunday}" title="#{myBundle.EditLocationTitle_openingHourSunday}" required="true" requiredMessage="#{myBundle.EditLocationRequiredMessage_openingHourSunday}" showOn="button"/>
</p:panelGrid>
<p:commandButton actionListener="#{locationController.save}" value="#{myBundle.Save}" update="display,:LocationListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,LocationEditDialog);"/>
<p:commandButton value="#{myBundle.Cancel}" onclick="LocationEditDialog.hide();"/>
</h:panelGroup>
</h:form>
</p:dialog>
</ui:define>
Use process = "#this" in p:commandButton and appendTo="#(body)"in p:dialog
solved issue, updated to primefaces 4.0 RC1, changed appendToBody="true", to appendTo="#(body)"
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.