I am creating a view in JSF where after executing some action with a4j:commandButton some elements are rerendered. For example I click on a button which invokes a backing bean method such as executeProcess (this adds a process to a list), and when it finishes updates a data table (shows the available processes). The data table also has some other buttons to execute specific actions over every process, but when I press one of this the page seems to reload entirely without invoking the action, then if I press the same button again it works. What is happening?
Component List an execute:
<div class="line_left" style="float:right">
<a4j:outputPanel id="execProcessPanel" layout="block"
ajaxRendered="true">
<ui:fragment rendered="#{tapeTapeForm.size > 0}">
<h:form id="executeProcess">
<h:outputText value="Ejecuta Proceso" />
<br />
<h:outputLabel id="inputFilesLabel" for="inputFile" value="Archivo" />
<h:selectOneListbox id="inputFile" size="5" required="true"
requiredMessage="Debes seleccionar un archivo"
value="#{tapeTapeForm.inputFile}">
<f:selectItems value="#{tapeTapeForm.inputFiles}" var="file"
itemLabel="#{file}" itemValue="#{file}" />
</h:selectOneListbox>
<br />
<h:message for="inputFile" errorClass="" />
<br />
<a4j:commandButton value="Ejecutar" styleClass="button"
action="#{tapeTapeForm.executeProcess}"
render="resultListPanel execProcessPanel messages"
limitRender="true">
<f:setPropertyActionListener value="0"
target="#{tapeTapeForm.tipoProceso}" />
</a4j:commandButton>
<a4j:commandButton value="Revisión" styleClass="button"
action="#{tapeTapeForm.executeProcess}"
render="resultListPanel execProcessPanel messages"
limitRender="true">
<f:setPropertyActionListener value="1"
target="#{tapeTapeForm.tipoProceso}" />
</a4j:commandButton>
</h:form>
</ui:fragment>
</a4j:outputPanel>
</div>
Component Data Table:
<a4j:outputPanel id="resultListPanel" layout="block"
ajaxRendered="true">
<h2>
<h:outputText value="Listado de Procesos Tape to Tape" />
</h2>
<rich:dataTable id="resultList" var="item" rows="0"
value="#{tapeTapeForm.processes}" noDataLabel="Sin Procesos">
<rich:column sortable="true" sortBy="#{item.id}">
<f:facet name="header">
<h:outputText value="ID" />
</f:facet>
<center>
<h:outputText value="#{item.id}" />
</center>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Nombre Archivo" />
</f:facet>
<center>
<h:outputText value="#{item.inputFileName}" />
</center>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Archivo Salida" />
</f:facet>
<center>
<h:outputText value="#{item.outputFileName}"
title="Clic para descargar el archivo de salida" />
</center>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Tipo Proceso" />
</f:facet>
<center>
<h:outputText value="Reporte"
title="Este proceso generará un reporte"
rendered="#{item.tipoProceso == 0}" />
<h:outputText value="Revisión"
title="Se realizará una revisión del archivo"
rendered="#{item.tipoProceso == 1}" />
</center>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Estatus" />
</f:facet>
<center>
<h:outputText value="#{item.status.description}"
title="#{item.status.detail}" />
</center>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Progreso" />
</f:facet>
<rich:progressBar value="#{item.avance}" minValue="0"
enabled="false" rendered="#{item.status.id == 3}"
maxValue="#{item.total}" label="#{item.avance} / #{item.total}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Detener" />
</f:facet>
<h:form rendered="#{item.status.id == 2 or item.status.id==3}">
<h:commandLink action="#{tapeTapeForm.stopProcess}" value="STOP"
onclick="#{rich:component('ajaxLoadingModalBox')}.show()">
<f:setPropertyActionListener target="#{tapeTapeForm.id}"
value="#{item.id}" />
</h:commandLink>
</h:form>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Eliminar" />
</f:facet>
<h:form rendered="#{item.status.id !=2 and item.status.id != 3}">
<h:commandLink action="#{tapeTapeForm.removeProcess}"
value="ELIMINAR">
<f:setPropertyActionListener target="#{tapeTapeForm.id}"
value="#{item.id}" />
</h:commandLink>
</h:form>
</rich:column>
</rich:dataTable>
</a4j:outputPanel>
I'm using RichFaces 4.2.2
Get rid of the multiple forms, wrap everything in one and then use if you need to limit the scope of execution.
Related
I am sorry for my English. I have a JBoss Seam Project and using primefaces in user interface.We have a dialog and inside a datatable. When i select a row im getting following error
ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost-127.0.0.1-8080-1) javax.resource.ResourceException: IJ000460: Error checking for a transaction
PersistenceException org.hibernate.exception.GenericJDBCException: Could not open connection
I thought maybe this error about hibernate but When i tired a lot of way about this problem i couldnt done it But when i moved dialog to new xhtml page it was done.I want to use dialog for my project instead of new page.Where is my mistake following code?
<h:form id="vehicleForm">
<p:commandButton id="selectClientButton" value="Musteri Sec" actionListener="#{clientFacade.clientSearchClear()}" />
</h:form>
<h:form id="selectClientForm">
<p:dialog widgetVar="selectClientDialog" resizable="true" draggable="true" modal="true" header="Arac Satis">
<h:panelGrid columns="4">
<h:outputText value="Adi" />
<h:outputText value="Soy Adı" />
<h:outputText value="TC/Vergi No." />
<h:outputText value="" />
<p:inputText value="#{clientFacade.client.name}" />
<p:inputText value="#{clientFacade.client.lastName}" />
<p:inputText value="#{clientFacade.client.taxNo}" />
<p:commandButton value="ARA" update=":selectClientForm:clientListDT" />
</h:panelGrid>
<p:dataTable id="clientListDT" rows="10" value="#{clientFacade.clientList}" var="client" >
<p:column style="width:3%" >
<p:commandLink id="test" actionListener="#{vehicleStockFacade.selectClient(client.clientId)}" ajax="false" >
<h:graphicImage value="#{icon.icon_select_mine_small}" rendered="#{client.isMyClient}" title="#{msg.choose}" width="15" height="15"/>
<h:graphicImage value="#{icon.icon_select_not_mine_small}" rendered="#{!client.isMyClient}" width="15" height="15" />
</p:commandLink>
</p:column>
<p:column>
<f:facet name="header" >
<h:outputText value="#{msg.client_name}" />
</f:facet>
<h:outputText value="#{client.name}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{msg.client_lastname}" />
</f:facet>
<h:outputText value="#{client.lastName}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{msg.tax_no}" />
</f:facet>
<h:outputText value="#{client.taxNo}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{msg.cell_phone}" />
</f:facet>
<h:outputText value="#{clientFacade.useMaskForPhone(client.mobilePhone)}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{msg.town}" />
</f:facet>
<h:outputText value="#{client.town}" />
</p:column>
<p:column>
<f:facet name="header" id="headerId" >
<h:outputText value="#{msg.address}" />
</f:facet>
<h:outputText value="#{client.addressLine1}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{msg.post_code}" />
</f:facet>
<h:outputText value="#{client.postCode}" />
</p:column>
</p:dataTable>
<f:facet name="footer">
<p:commandButton value="Secimi Kaldir" action="#{vehicleStockFacade.removeClientFromVehicleStock()}" style="float:right;margin-bottom:5px" ajax="false" />
</f:facet>
</p:dialog>
</h:form>
I am using PrimeFaces but I have problem with display <p:messages> for converterMessage.
When I use JSF tag <h:message>, it works correctly or even when I insert it into columns, but when I change to <p:message> it does not show. Can anybody helps me? My page is:
<h:form id="form2" prependId="false" style="direction:rtl;width: 600;top: 300px ;position: absolute" >
<p:messages for="count"/>
<p:outputLabel value="sum credit :#{shoppingBean.sumcredit}"/><br/>
<p:outputLabel value="shopping list :"/>
<p:dataTable id="dataTbl2" var="selectedProduct" value="#{shoppingBean.selectedProduct}" emptyMessage="no data"
paginatorAlwaysVisible="true" selection="#{shoppingBean.selection2}"
rowKey="#{selectedProduct.id}" disabledSelection="false" rows="5" paginator="true" pageLinks="5">
<p:column style="color: blue">
<f:facet name="header">
<h:outputText value="brand" />
</f:facet>
<h:outputText value="#{selectedProduct.tblShopProduct.brand}" />
</p:column>
<p:column style="color: blue">
<f:facet name="header">
<h:outputText value="price" />
</f:facet>
<h:outputText value="#{selectedProduct.tblShopProduct.price}" />
</p:column>
<p:column style="color: blue" >
<f:facet name="header">
<h:outputText value="date" />
</f:facet>
<h:outputText value="#{shoppingBean.tblShopOrder.created.toString().substring(0,11)}" />
<h:outputText value="#{shoppingBean.tblShopOrder.created.toString().substring(11,19)}" />
</p:column>
<p:column style="color: blue" >
<f:facet name="header">
<h:outputText value="number" />
</f:facet>
<h:outputText value="#{selectedProduct.number}" />
</p:column>
<p:column style="color: blue" >
<f:facet name="header">
<h:outputText value="amount" />
</f:facet>
<h:outputText value="#{selectedProduct.amount}" />
</p:column>
<p:column style="color: blue">
<f:facet name="header">
<h:outputText value="edit"/>**<h:inputText id="count" converterMessage="you allowed only for using number value="#{shoppingBean.count}"/>**
</f:facet>
<h:commandButton value="sum" rendered="#{selectedProduct.number==null}" action="#{shoppingBean.addProductCount(selectedProduct)}" />
<h:commandButton value="confirm" disabled="true" rendered="#{selectedProduct.number!=null}" />
</p:column>
<p:column style="color: blue" >
<f:facet name="header">
<h:outputText value="delete" />
</f:facet>
<h:commandButton value="delete" action="#{shoppingBean.deleteBuyed(selectedProduct)}" />
</p:column>
<f:facet name="footer">
<h:commandButton value="final shopping" action="#{shoppingBean.finalShop(selectedProduct)}" />
</f:facet>
</p:dataTable>
</h:form>
Tohid Makari.
<h:outputText value="edit"/>**<h:inputText id="count" converterMessage="you allowed only for using number value="#{shoppingBean.count}"/>**
This line could not work. Fix this first.
You do not update your messages tag.
Try something like this :
<p:messages for="count" autoUpdate="true" />
In my crud application I want to select a row and then display that row data in a popup. navigating to another page works and it displays the data. when I try to display it in my popup no values are displayed. I could be wrong but I think the popup opens before the method prepareView is done.
code block:
<h:column>
<f:facet name="header">
<h:outputText value=" "/>
</f:facet>
<h:commandLink id="myLink" value="Action" action="#{timeLoggingDetailController.prepareView}" rendered="#{item.timeLoggingId eq AdminTimeLogging.filteredId}" styleClass="auto-style5">
<rich:componentControl target="popup" operation="show"/>
</h:commandLink>
</h:column>
</h:dataTable>
</h:panelGroup>
</h:form>
<rich:popupPanel id="popup" modal="false" autosized="true" resizeable="false" domElementAttachment="form">
<f:facet name="header">
<h:outputText value="Approval level" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#" onclick="#{rich:component('popup')}.hide();
return false;">
Close
</h:outputLink>
</f:facet>
<h:form id="submitForm">
<h:panelGrid columns="2">
<h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_date}"/>
<h:outputText value="#{timeLoggingDetailController.selected.date}" title="#{bundle.ViewTimeLoggingDetailTitle_date}">
<f:convertDateTime pattern="MM/dd/yyyy" />
</h:outputText>
<h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_description}"/>
<h:outputText value="#{timeLoggingDetailController.selected.description}" title="#{bundle.ViewTimeLoggingDetailTitle_description}"/>
<h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_normalHours}"/>
<h:outputText value="#{timeLoggingDetailController.selected.normalHours}" title="#{bundle.ViewTimeLoggingDetailTitle_normalHours}"/>
<h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_overtimeHours}"/>
<h:outputText value="#{timeLoggingDetailController.selected.overtimeHours}" title="#{bundle.ViewTimeLoggingDetailTitle_overtimeHours}"/>
<h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_doubleTimeHours}"/>
<h:outputText value="#{timeLoggingDetailController.selected.doubleTimeHours}" title="#{bundle.ViewTimeLoggingDetailTitle_doubleTimeHours}"/>
<h:outputText value="#{bundle.ViewTimeLoggingDetailLabel_approvalLevelsId}"/>
<h:outputText value="#{timeLoggingDetailController.selected.approvalLevelsId}" title="#{bundle.ViewTimeLoggingDetailTitle_approvalLevelsId}"/>
</h:panelGrid>
<br />
<h:panelGrid class="auto-style4">
<h:commandLink action="#{timeLoggingDetailController.update}" value="#{bundle.EditTimeLoggingDetailSaveLink}" onclick="#{rich:component('popup')}.hide();" styleClass="linkbutton"/>
</h:panelGrid>
</h:form>
</rich:popupPanel>
</ui:define>
</ui:composition>
</html>
You may want to use <a4j:commandLink>, it provides oncomplete event which is fired when the action completes.
This should work for you:
<a4j:commandLink id="myLink" value="Action" actionListener="#{timeLoggingDetailController.prepareView}" rendered="#{item.timeLoggingId eq AdminTimeLogging.filteredId}" styleClass="auto-style5">
<rich:componentControl event="complete" target="popup" operation="show"/>
</a4j:commandLink>
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 want to fill a rich:extendedDataTable with a static columns and dynamic columns in RichFaces 4.2
I tried following code,but it's not working for me :
<rich:extendedDataTable id="listDipRec"
iterationStatusVar="itDipRec" rows="200"
value="#{declarationReglementaireModel.detailCurrentDecReg.decReg.listLigneDipRecsDTO}"
var="ligneDipRec" frozenColumns="1"
style="height:300px; width:800px;" selectionMode="none">
<rich:column width="35px">
<h:panelGrid columns="1" cellpadding="2">
<a4j:commandLink render="editGridDipRec" execute="#this"
oncomplete="#{rich:component('modifDipRec')}.show()">
<span class="icone icone-edit icone-align-center" />
<a4j:param value="#{itDipRec.index}"
assignTo="#{declarationReglementaireModel.currentLigneDipRecIndex}" />
<f:setPropertyActionListener
target="#{declarationReglementaireModel.currentLigneDipRec}"
value="#{ligneDipRec}" />
</a4j:commandLink>
</h:panelGrid>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Date ligne fichier Dip" />
</f:facet>
<h:outputText value="#{ligneDipRec.dtLigneDipRec}">
<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Europe/Paris" />
</h:outputText>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Référence titre" />
</f:facet>
<h:outputText value="#{ligneDipRec.rfTitre}">
</h:outputText>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Origine titre" />
</f:facet>
<h:outputText value="#{ligneDipRec.lbOrigineLigne}">
</h:outputText>
</rich:column>
<c:forEach items="#{ligneDipRec.listDonneeDipRecDTO}" var="column"
varStatus="status">
<rich:column>
<f:facet name="header">
<h:outputText value="Valeur rubrique" />
</f:facet>
<h:outputText value="#{declarationReglementaireModel.getColumnData(ligneDipRec,column).lbValeurRubrique}" />
</rich:column>
</c:forEach>
</rich:extendedDataTable>
<c:forEach> doesn't have access to the table's variables (i.e. ligneDipRec), and unfortunately you can't do anything about it.
The good news is that whatever you put inside the forEach will have access to those variables. The only thing you need to do is to save the size of the list somewhere in the bean and then loop over it, rather than over the variable:
<c:forEach var="columnNumber" begin="0"
end="{declarationReglementaireModel.detailCurrentDecReg.decReg.listSize - 1}">