p:selectBooleanButton primefaces-mobile doesn't change - jsf

My p:selectBooleanButton doesn't respond on any click and has this check box at the corner that does respond when I click on it but the label on the button doesn't change at all! maybe someone had this problem and can help me. I'm using primefaces 3.5 and primefaces-mobile 0.9.5 with glassfish 3.1.2.2 server.
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pm="http://primefaces.org/mobile"
contentType="text/html"
renderKitId="PRIMEFACES_MOBILE">
<pm:page id="page" title="reservation">
<f:facet name="postinit">
<link rel="stylesheet"
href="#{request.contextPath}/javax.faces.resource/calendar/calendar.css.jsf?ln=primefaces-mobile" />
<link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/css/jquery.mobile-1.4.0.css" />
<h:outputScript library="js" name="jquery.mobile-1.4.0.js" target="head" />
<h:outputScript library="primefaces-mobile" name="calendar/calendar.js" />
</f:facet>
<pm:view id="menu" swatch="a" >
<pm:header title="reservation">
<f:facet name="left"><p:button value="Back" icon="back" onclick="PrimeFaces.back()"/>
</f:facet>
</pm:header>
<pm:content >
<h:form >
<p:growl id="messageOverlay" />
<h4>reservation date</h4>
<p:calendar value="#{reservationBean.reservDate}" mode="popup" pattern="dd/MM/yyyy HH:mm" stepMinute="30" mindate="01/01/2014"/>
<h4>party size</h4>
<pm:inputRange id="range" minValue="0" maxValue="20" value="#{reservationBean.reservPartySize}" />
<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
<h:selectOneMenu value="#{reservationBean.reservZone}" >
<f:selectItem itemLabel="Outside" itemValue="outside" />
<f:selectItem itemLabel="Inside" itemValue="inside" />
<f:selectItem itemLabel="Vip" itemValue="vip" />
</h:selectOneMenu>
<p:selectBooleanButton onLabel="yes" offLabel="no" value="#{reservationBean.smokingFlag}" label="aa" />
</h:panelGrid>
<p:commandLink style="width:20%" actionListener="#{reservationBean.reservate}" update=":basicDialog" oncomplete="dlg.show();">
<p:graphicImage style="width: 20%;border: 0; " value="/resources/images/reservation.png" />
</p:commandLink>
</h:form>
<p:growl id="basicDialog" showDetail="true" life="5000" />
</pm:content>
</pm:view>
</pm:page>
`

Related

PF 11 updates the whole page when navigating in composite page

after updating from pf 7 to pf 11 I have undesirable behavior when navigating in a composite xhtml.
I have a p:tree element on the west, and an ui:insert in the center which includes the composite content which is
updated when clicking on tree nodes). After I have migrated to pf 11 when I click on a node in the tree, not only
the content gets updated, but the tree as well. The problem is when the tree gets expanded to the point where
it cannot be whole visible and the scroll bar is rendered and I scroll to the lower part and click on a node, the
tree gets updated and it scrolls all the way up.
The template page looks like this
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<f:facet name="first">
<meta content='text/html; charset=UTF-8' http-equiv="Content-Type" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="refresh" content="#{facesContext.externalContext.sessionMaxInactiveInterval};url=#{request.contextPath}/errorpages/session_expired.xhtml"/>
<link rel="shortcut icon" type="image/x-icon" href="#{request.contextPath}/resources/images/favicon.ico" />
<title><ui:insert name="title">#{sessionController.appName}</ui:insert></title>
</f:facet>
</h:head>
<h:body onload="scrollTreeMenu();" >
<p:growl id="growlMessages" for="globalMsg" />
<p:growl id="permanetnMessage" for="permMsg" sticky="true" />
<p:blockUI block="centerPanel" widgetVar="blockCenterWidget">
<p:graphicImage library="images" name="ajax-loader.gif" />
</p:blockUI>
<p:blockUI block="headerForm" widgetVar="blockNorthWidget" />
<p:blockUI block="treeNodes" widgetVar="blockWestWidget" />
...
<div class="p-grid">
<div id="west" class="p-col" style="flex: inherit;">
<p:panel toggleable="true" toggleOrientation="horizontal" header="Menu" style="width: fit-content; width: -moz-fit-content;">
<h:form id="treeNodes">
<p:outputPanel style="width: 100%; height: 700px; overflow: auto; display: block;">
<p:tree id="menuTree" value="#{sessionController.treeRootNode}" var="treeNode" dynamic="true" cache="false"
selectionMode="single" selection="#{sessionController.selectedNode}" widgetVar="mainTreeMenuWidget" style="line-height: 1;">
<p:ajax event="select" listener="#{sessionController.onNodeSelect}" />
<p:ajax event="expand" listener="#{sessionController.onNodeExpand}" />
<p:ajax event="collapse" />
<p:treeNode collapsedIcon="pi pi-folder" expandedIcon="pi pi-folder-open">
<h:outputText id="adminFolder" value="#{treeNode.rowKey}" title="#{treeNode.rowKey}" />
<p:tooltip for="adminFolder" position="top" showDelay="500" />
</p:treeNode>
<p:treeNode type="Folder" collapsedIcon="pi pi-folder" expandedIcon="pi pi-folder-open">
<h:outputText id="folder" value="#{treeNode.rowKey}" title="#{treeNode.rowKey}" />
<p:tooltip for="folder" position="top" showDelay="500" />
</p:treeNode>
<p:treeNode type="ItemTable" icon="pi pi-table">
<h:outputText id="itemTableNode" value="#{treeNode.rowKey}" title="#{treeNode.rowKey}" />
<p:tooltip for="itemTableNode" position="top" showDelay="500" />
</p:treeNode>
...
</p:tree>
...
</p:outputPanel>
</h:form>
</p:panel>
</div>
<div id="center" class="p-col" style="overflow: auto;">
<p:outputPanel id="centerPanel">
<ui:insert name="content">Content commes here...</ui:insert>
</p:outputPanel>
</div>
</div>
...
</h:body>
</html>
and the page that shows the content looks like this
<ui:composition template="/WEB-INF/jsf-templates/layout_template.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core">
<ui:define name="content">
<h:form id="analysisForm" rendered="#{not analysisController.analysisInfo.disabled}">
<p:remoteCommand name="loadData" actionListener="#{analysisController.loadData}"
onstart="PF('blockCenterWidget').show(); PF('blockNorthWidget').show(); PF('blockWestWidget').show();"
oncomplete="PF('blockCenterWidget').hide(); PF('blockNorthWidget').hide(); PF('blockWestWidget').hide();"
process="#this" update=":analysisForm" />
...
</h:form>
...
</ui:define>
</ui:composition>
best regards
Andrija

selectonemenu not appearing primefaces

I'm trying to make primefaces elements appear on my pages by taking code from the showcase, the menu worked well after some modifications but the selectonemenu refuses to appear.
it's not showing anything in the layout unit.
This is my xhtml code :
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>Consultation Travaux Soumis (Etudiant)</title>
<style type="text/css">
.ui-widget,.ui-widget .ui-widget {
font-size: 90% !important;
}
</style>
</h:head>
<body>
<p:layout fullPage="true">
<p:layoutUnit position="north" size="158" header="Intranet" resizable="false" closable="false" collapsible="false">
<h:graphicImage value="/img/Logo.jpg" width="110" height="110"/>
<h:outputText value=" Consultation de la liste de travaux" />
</p:layoutUnit>
<p:layoutUnit position="west" size="200" header="Menu" resizable="true" closable="true" collapsible="true">
<h:form id="pmenu">
<p:menu style="width:90%">
<p:submenu label="Navigation">
<p:menuitem value="Acceuil" action="#" immediate="true" icon="ui-icon ui-icon-home"/>
<p:menuitem value="Deconnexion" action="#{PagesController.logout}" immediate="true" icon="ui-icon ui-icon-locked"/>
</p:submenu>
<p:submenu label="Services">
<p:menuitem value="Emploi du Temps" actionListener="#" immediate="true" ajax="false" icon="ui-icon ui-icon-suitcase" disabled="true"/>
<p:menuitem value="Relevé de Notes" actionListener="#" immediate="true" ajax="false" icon="ui-icon ui-icon-folder-collapsed" disabled="true"/>
<p:menuitem value="Remise de Doc." url="/secure/remisetrEt.xhtml" immediate="true" ajax="false" icon="ui-icon ui-icon-folder-open" />
</p:submenu>
<p:submenu label="Infos">
<p:menuitem value="Réclamation" actionListener="#" immediate="true" ajax="false" icon="ui-icon ui-icon-alert" />
<p:menuitem value="A Propos" actionListener="#" immediate="true" ajax="false" icon="ui-icon ui-icon-info" />
</p:submenu>
</p:menu>
</h:form>
</p:layoutUnit>
<p:layoutUnit position="center">
<h:form>
<h:panelGrid columns="1" style="margin-bottom:10px" cellpadding="5">
<p:selectOneMenu>
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItem itemLabel="Option 1" itemValue="1" />
<f:selectItem itemLabel="Option 2" itemValue="2" />
<f:selectItem itemLabel="Option 3" itemValue="3" />
</p:selectOneMenu>
</h:panelGrid>
</h:form>
</p:layoutUnit>
</p:layout>
</body>
</html>
Your code works. Which version of primefaces are you using? Which app server are you deploying to? Which browser have you tested in? Is there anything else on the page besides the selectonemenu?
Try the following. Work with Primefaces 4 on Glassfish 3.
<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui"
xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<f:view contentType="text/html">
<h:head>
<f:facet name="first">
<meta content='text/html; charset=UTF-8' http-equiv="Content-Type" />
<title>Test</title>
<link type="text/css" rel="stylesheet"
href="#{request.contextPath}/css/default.css" />
<link type="text/css" rel="stylesheet"
href="#{request.contextPath}/css/custom.css" />
</f:facet>
</h:head>
<h:body>
<h:form>
<h:panelGrid columns="1" style="margin-bottom:10px" cellpadding="5">
<p:selectOneMenu>
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItem itemLabel="Option 1" itemValue="1" />
<f:selectItem itemLabel="Option 2" itemValue="2" />
<f:selectItem itemLabel="Option 3" itemValue="3" />
</p:selectOneMenu>
</h:panelGrid>
</h:form>
</h:body>
</f:view>
</html>
The problem was that I have to bind my selectonemenu to a property of a managed bean I have.

JSF datatable, tomahawk radio

I'm attempting to use a t:radio in my rich:datatable but it's always complaining about the fact that it can't find the component. I did some googling and I have to declare the full name, but I actually think I'm doing that.
Anyone can point me what I'm doing wrong? The code (I'm not going to give a minified version because I'm guessing it's going wrong with the compositions):
letterDetailTemplate.xhtml:
<h:form id="generateLetterForm">
<ui:include src="addStandardLetterMain.xhtml" />
<ui:include src="addStandardLetterText.xhtml" />
<ui:include src="buttons.xhtml" />
</h:form>
addStandardLetterText.xhtml (the radio button is over here, in the slrDataTable):
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:e="http://minfin.regondes2/entity"
xmlns:ccffdecorate="http://java.sun.com/jsf/composite/ccffdecorate"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:l="http://minfin.regondes2/layout"
xmlns:o="http://omnifaces.org/ui"
xmlns:t="http://myfaces.apache.org/tomahawk">
<ui:param name="entityBB" value="#{letterBB}" />
<ui:param name="type" value="Dossier.Letter" />
<l:screenzone id="addStandardLetterTextPanel"
title="#{AppMessages[type.concat('.addStandardLetterText.title')]}">
<h:outputStylesheet name="letterText.css" library="stylesheets" />
<h:outputScript name="letter.js" library="scripts" />
<a4j:region>
<a4j:outputPanel id="letterTextPanel">
<h:inputTextarea id="letterText" name="letterText"
value="#{entityBB.entity.text}" styleClass="letterText" />
<script type="text/javascript">
language: '#{screen.locale.language}'
CKEDITOR.replace( 'generateLetterForm:letterTex', {
});
</script>
</a4j:outputPanel>
<h:panelGroup styleClass="rButtonPanelAlignLeft" layout="block"
rendered="#{dossierContextBB.dossierContext == 'EDIT'}">
<a4j:commandButton
value="#{AppMessages[type.concat('.add.region')]}"
actionListener="#{entityBB.findAvailableRegionStandardLetters()}"
render="slrPopupFormPanel" limitRender="true" status="ajaxStatus"
onclick="LETTER.CKUpdate()"
oncomplete="#{rich:component('addStandardLetterRegion')}.show();" />
</h:panelGroup>
</a4j:region>
<rich:popupPanel id="addStandardLetterRegion" modal="true"
onmaskclick="#{rich:component('addStandardLetterRegion')}.hide()"
autosized="true">
<f:facet name="header">
<h:outputText
value="#{AppMessages['Dossier.Letter.StandardLetter.region.popup.title']}" />
        </f:facet>
<f:facet name="controls">
<h:outputLink value="#"
onclick="#{rich:component('addStandardLetterCentrum')}.hide(); return false;">
X
</h:outputLink>
</f:facet>
<a4j:outputPanel id="slrPopupFormPanel">
<t:selectOneRadio id="slrOption"
value="#{standardLetterBB.selected}" layout="spread"
converter="#{standardLetterBB.converter}">
<f:selectItems value="#{entityBB.availableStandardLetterText}"
var="standardLetter" itemLabel="" itemValue="#{standardLetter}" />
</t:selectOneRadio>
<rich:dataTable id="slrDataTable"
value="#{entityBB.availableStandardLetterText}"
var="standardLetter" noDataLabel="No standard letters found"
rowKeyVar="index">
<rich:column headerClass="ListTitle">
<t:radio for="generateLetterForm:slrDataTable:slrOption" index="#{index}" />
</rich:column>
<e:column entity="#{standardLetter.dossierType}" type="#{type}"
property="type" />
<e:column entity="#{standardLetter}" type="#{type}"
property="numbering" />
<e:columnTranslatable entity="#{standardLetter}" type="#{type}"
property="text" />
</rich:dataTable>
</a4j:outputPanel>
<div class="rButtonPanel">
<h:commandButton value="#{AppMessages['general.action.add']}">
<a4j:ajax event="click" execute="generateLetterForm"
listener="#{entityBB.addMotivationToReport}"
oncomplete="#{rich:component('addStandardLetterRegion')}.hide()"
render="reportMotivationTextPanel" limitRender="true" />
</h:commandButton>
<a4j:commandButton value="#{AppMessages['general.action.cancel']}"
onclick="#{rich:component('addStandardLetterRegion')}.hide()"
limitRender="true" immediate="true" bypassUpdates="true" />
</div>
</rich:popupPanel>
</l:screenzone>
Note that this view works and renders and displays the data from the backingbean when I remove the t:radio.
The errormessage I'm getting is:
SEVERE: java.lang.IllegalStateException: Could not find component 'generateLetterForm:slrDataTable:slrOption' (calling findComponent on component 'generateLetterForm:slrDataTable:0:j_idt258')
javax.faces.FacesException: java.lang.IllegalStateException: Could not find component 'generateLetterForm:slrDataTable:slrOption' (calling findComponent on component 'generateLetterForm:slrDataTable:0:j_idt258')
Change for="generateLetterForm:slrDataTable:slrOption" to for=":generateLetterForm:slrOption" and specify id for your t:radio in datatable also. Don't forget the ":" before generateLetterForm.

after click menu, PrimeFaces layout needs manual refresh

In My project, I want to implement that when someone access ,need to popup a login Dialogue box first (Hide the main page menu and other element.. just let u see the login box ) .then if you put in right info, hide the loginbox and display layout to u .
Now question is : when hide the box , yeah, you can see the layout and looks nice , but when you click the link in the menu, the center all layout display to none. But when you refresh browser again , you can see it again
I'm sure whether i update wrong id or something else .
Following is the code refer and catch exception .Wait your answer. Very important to me .
Best Regards and Thank .
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<f:view contentType="text/html">
<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
<meta content='text/html; charset=UTF-8' http-equiv="Content-Type" />
<title>SingTel - eshop Operation Maintaince</title>
<link rel="shortcut icon"
href="#{request.contextPath}/images/system/favicon.ico" />
</f:facet>
<link type="text/css" rel="stylesheet"
href="#{request.contextPath}/css/default.css" />
<link type="text/css" rel="stylesheet"
href="#{request.contextPath}/css/syntaxhighlighter/syntaxhighlighter.css" />
<style type="text/css">
</style>
<script type="text/javascript">
function handleLoginRequest(xhr, status, args) {
if(args.validationFailed || !args.loggedIn) {
jQuery('#dialog').effect("shake", { times:5 }, 100);
} else {
dlg.hide();
jQuery('#loginLink').fadeOut();
}
}
</script>
</h:head>
<h:body>
<p:outputPanel id="mainPanel" autoUpdate="true">
<p:layout fullPage="true" id="layout" rendered="#{esUserSessionBean.showLogin == true ? false : true}">
<p:layoutUnit id="left" position="west" closable="false"
collapsible="true" style="border:0px" header="MENU">
<h:form id="menuForm">
<p:slideMenu
style="width:272px;height:600px;margin-left:-3px;margin-top:-6px;"
id="tree">
<p:submenu label="Test EJB " icon="ui-icon-play">
<p:menuitem value="Test EJB " action="#{navigationBean.doNav}"
update=":centerContentPanel" icon="ui-icon-arrow-4-diag">
<f:param name="urlParam" value="ui/testEJB/testEJB" />
</p:menuitem>
</p:submenu>
</p:slideMenu>
</h:form>
</p:layoutUnit>
<p:layoutUnit id="center" position="center" style="border:0px;">
<p:outputPanel id="centerContentPanel">
<ui:include src="../#{navigationBean.pageName}.xhtml" />
</p:outputPanel>
</p:layoutUnit>
</p:layout>
</p:outputPanel>
<p:outputPanel id="loginPanel" autoUpdate="true">
<p:dialog id="dialog" header="Login" widgetVar="dlg" closable="false"
visible="#{esUserSessionBean.showLogin}"
modal="true"
>
<h:form id="loginForm">
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel for="username" value="Username:" />
<p:inputText id="username" value="#{esUserSessionBean.userId}"
required="true" label="username" />
<h:outputLabel for="password" value="Password:" />
<p:password id="password" value="#{esUserSessionBean.password}"
required="true" label="password" feedback="false" />
<f:facet name="footer">
<p:commandButton id="loginButton" value="Login"
actionListener="#{esUserSessionBean.login}"
oncomplete="handleLoginRequest(xhr, status, args) " />
</f:facet>
</h:panelGrid>
</h:form>
</p:dialog>
</p:outputPanel>
</h:body>
</f:view>
</html>
You need to wrap your #loginLink inside an <h:panelGroup rendered=#{not bean.isLogged}"></h:panelGroup>. The bean.isLogged will be a setter of your choice that return true if the user is connected.
With that, when you refresh the page, the link won't be displayed. Altought, I don't find your #loginLink inside your code snippet.

Primefaces datalist ajax-pagination dialog not updated

I'm trying to use primefaces dialog update method by primefaces here and i've replaced the bean and its methods with my bean.
This is what i did
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../Styles/homepage-style.css" />
<link rel="stylesheet" type="text/css" href="../Styles/profile.css" />
<title>Shadi Bandhan | We find the best match for you</title>
</h:head>
<h:body>
<h:form id="form">
<p:dataList value="#{messagesManagedBean.userInboxMsgs}" var="msg" id="cars"
paginator="true" rows="5"
paginatorTemplate="{PreviousPageLink} {CurrentPageReport} {NextPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15" type="none">
<f:facet name="header">
Cars
</f:facet>
<p:commandButton icon="ui-icon-search" update=":form:carDetail" oncomplete="carDialog.show()" title="View Detail">
<f:setPropertyActionListener value="#{msg}" target="#{messagesManagedBean.selectedMessage}" />
</p:commandButton>
<h:outputText value="#{msg.message}, #{msg.userFullname}" style="margin-left:10px" />
<br />
</p:dataList>
<p:dialog header="Car Detail" widgetVar="carDialog" modal="true" showEffect="fade">
<p:outputPanel id="carDetail" style="text-align:center;" layout="block">
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel for="modelNo" value="Message: " />
<h:outputText id="modelNo" value="#{messagesManagedBean.selectedMessage.message}" />
<h:outputLabel for="year" value="Full name: " />
<h:outputText id="year" value="#{messagesManagedBean.selectedMessage.userFullname}" />
<h:outputLabel for="color" value="User Id: " />
<h:outputText id="color" value="#{messagesManagedBean.selectedMessage.userId}" style="color:#{tableBean.selectedCar.color}"/>
</h:panelGrid>
</p:outputPanel>
</p:dialog>
</h:form>
</h:body>
</html>
It opens the dialog but does not show the values. (Dialog is not getting updated)
*Note*Before, when i used ui:repeat instead of datalist, it was fine with the f:param method.
Thanks
<h:form id="form">
<p:dataList value="#{tableBean.cars}" var="car" id="cars"
paginator="true" rows="10"
paginatorTemplate="{PreviousPageLink} {CurrentPageReport} {NextPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="10,15" type="none">
<p:column>
<f:facet name="header">
Notificaciones
</f:facet>
<p:commandButton icon="ui-icon-search" update=":form:carDetail" oncomplete="carDialog.show()" title="View Detail">
<f:setPropertyActionListener value="#{car}" target="#{tableBean.selectedCar}" />
</p:commandButton>
<h:outputText value="#{car.manufacturer}, #{car.year}" style="margin-left:10px" />
<br />
</p:column>
</p:dataList>
And the answer is
Putting the commandlink or commandbutton in the <p:column></p:column> solved my problem.

Resources