I am working with Primefaces 3.5, Spring 3.2, JSF 2.2 and Apache is my server.
My problem is that whenever i click on the row, the row select event is never triggered in my backing bean and my store details panel is never updated.
My backing bean is in request scope and contains onRowSelect method. However when i change my backing bean to sessions scope(it requires a few changes in backing bean), instant row selection works.
For the simplicity of my question i have modified my code to include only relevant part. In my param, for the sake of testing i just put existing customer with ID 35 in my test page.
Here is my dialog.xhtml
<h:form id="customerListingsForm">
<p:dialog id="manageStoresDialog"
header="Manage #{manageStoreBean.store.owner.name}'s Stores"
widgetVar="manageStoresDlg"
modal="true"
resizable="false">
<p:panelGrid id="storePanel" rendered="#{manageStoreBean.owner != null}">
<f:facet name="header">
<p:row>
<p:column>Store Details</p:column>
<p:column>Customer Store List</p:column>
</p:row>
</f:facet>
<p:row>
<p:column>
<p:panelGrid id="storeDetails">
<p:row>
<p:column>Name: </p:column>
<p:column>
<h:inputText value="#{manageStoreBean.store.name}" />
</p:column>
</p:row>
<p:row>
<p:column>Description: </p:column>
<p:column>
<h:inputText value="#{manageStoreBean.store.description}" />
</p:column>
</p:row>
<p:row>
<p:column>Short Code: </p:column>
<p:column>
<h:inputText value="#{manageStoreBean.store.shortCode}" />
</p:column>
</p:row>
<p:row>
<p:column>Owner name:</p:column>
<p:column>
<h:inputText value="#{manageStoreBean.store.owner.name}" readonly="true" />
</p:column>
</p:row>
<p:row>
<p:column>Store Type: </p:column>
<p:column>
<p:selectOneMenu
id="storeTypeSelected"
value="#{manageStoreBean.placeType}"
var="storeType"
style="height:25px"
converter="#{placeTypeConverter}">
<f:selectItems
value="#{manageStoreBean.typeList}"
var="storeTypeItem"
itemLabel="#{storeTypeItem.code}"
itemValue="#{storeTypeItem}"/>
<p:column>#{storeType.description}</p:column>
</p:selectOneMenu>
</p:column>
</p:row>
<p:row>
<p:column>Country: </p:column>
<p:column>
<p:selectOneMenu
id="storeCountrySelected"
value="#{manageStoreBean.country}"
var="country"
style="height:25px"
converter="#{countryConverter}">
<f:selectItems
value="#{manageStoreBean.countryList}"
var="countryItem"
itemLabel="#{countryItem.isoNumericCode}"
itemValue="#{countryItem}"/>
<p:column>#{country.isoNumericCode}</p:column>
</p:selectOneMenu>
</p:column>
</p:row>
<p:row>
<p:column>Localisation: </p:column>
<p:column>
<p:selectOneMenu
id="storeLocalisationSelected"
value="#{manageStoreBean.localisationData}"
var="storeLocal"
style="height:25px"
converter="#{localisationConverter}">
<f:selectItems
value="#{manageStoreBean.localisationList}"
var="local"
itemLabel="#{local.regionCode}"
itemValue="#{local}"/>
<p:column>#{storeLocal.id} - #{storeLocal.regionCode}</p:column>
</p:selectOneMenu>
</p:column>
</p:row>
</p:panelGrid>
</p:column>
<p:column style="width:250px">
<p:dataTable id="stores"
var="store"
value="#{manageStoreBean.storeList}"
rowKey="#{store.id}"
scrollHeight="240"
scrollable="true"
selectionMode="single"
selection="#{manageStoreBean.selectedStore}"
lazy="true">
<p:ajax event="rowSelect" immediate="true"
listener="#{manageStoreBean.onRowSelect}"
update=":customerListingsForm:storeDetails"/>
<p:column headerText="Salon Name">
<h:outputText value="#{store.name}" />
</p:column>
<p:column headerText="ID">
<h:outputText value="#{store.id}" />
</p:column>
</p:dataTable>
</p:column>
</p:row>
</p:panelGrid>
<p:commandButton
value="Save"
action="#{manageStoreBean.saveStore}"
oncomplete="manageStoresDlg.hide()">
<f:param name="storeCustomerId" value="#{manageStoreBean.owner.id}" />
</p:commandButton>
<h:outputText value=" " />
<p:commandButton
value="Close"
oncomplete="manageStoresDlg.hide()"/>
</p:dialog>
<p:commandButton value="Add Store"
oncomplete="manageStoresDlg.show()"
update=":customerListingsForm:manageStoresDialog"
process="@this">
<f:param name="storeCustomerId" value="35" />
</p:commandButton>
</h:form>
Also i'm new to primefaces and web dev, but did a lot of learning myself before i started this project. I spent 2 days try to understand what's wrong and searched all web but could not find any solution. May be i'm missing something or doing wrong not sure.
Any help is much appreciated.