dataTable single selection update

UI Components for JSF
Post Reply
tassos
Posts: 22
Joined: 01 Oct 2010, 10:50

01 Oct 2010, 19:00

Hi all,

Since I informed (in another topic) that in 2.1 version (which I am using), there is no single selection radio button option in the <p:dataTable>, I tried to use the
single selection feature without the selection column.
I want to update the contents of a panel after a row selection.
The problem that I am facing is that the panel is updated only in the first selection!
All the subsequent selections in the dataTable result in no action and no update in the panel's content.

Here is the related code:
<p:dataTable id="tasksTable"
paginator="true"
paginatorPosition="top" height="100%"
rows="5" scrollable="false"
value="#{taskListBean.userTasks}"
var="task"
lazy="false" dynamic="false"
selection="#{taskListBean.selectedTask}"
selectionMode="single"
update="taskDetailsUpdatePanel">

<p:column sortBy="#{task.taskInstanceId}">
<f:facet name="header">
<h:outputText value="Task Instance Id" />
</f:facet>
<h:outputText value="#{task.taskInstanceId}" />
</p:column>
.........................other columns...............

</p:dataTable>


<p:outputPanel id="taskDetailsUpdatePanel">

<p:panel id="taskDetailsPanel"
header="Detail: Account Open - Access account request"
styleClass=".tr-panel">

<h:panelGrid id="tasksResultsGridId1" columns="1" border="2" cellspacing="0" width="100%">
<h:panelGroup id="tasksResultsPanelGroupId1">

<table id="taksDetailsTableProperties" align="left">
....table's contents...........
</table>
</h:panelGroup>
</h:panelGrid>
</p:panel>

<p:panel styleClass=".tr-panel">
<h:panelGrid id="tasksResultsGridId2" columns="1" border="2" cellspacing="0" width="100%">
<h:panelGroup id="tasksResultsPanelGroupId2">
<table>
<tr>
<td>
<h:outputLabel for="descriptionDetails">
<h:outputText value="Description:" />
</h:outputLabel>

<h:outputText id="descriptionDetails" value="#{taskListBean.selectedTask.taskDescr}" />
</td>
</tr>
</table>
</h:panelGroup>
</h:panelGrid>
</p:panel>

<p:panel id="sourceLinkPanelId" styleClass=".tr-panel">
<h:panelGrid id="tasksResultsGridId3" columns="1" border="2" cellspacing="0" width="100%">
<h:panelGroup id="tasksResultsPanelGroupId3">
<table>
<tr>
<td>
<h:outputLabel for="sourceLinkId" styleClass="default">
<h:outputText value="Request: " />
</h:outputLabel>
<h:commandLink id="sourceLinkId" action="null" styleClass="default">
<h:outputLabel for="descriptionDetails">
<h:outputText value="Source id" />
</h:outputLabel>
</h:commandLink>
</td>
</tr>
</table>
</h:panelGroup>
</h:panelGrid>
</p:panel>

</p:outputPanel>


Can anyone explain why I get this wrong behavior?

Thanks,
Tassos.
Primefaces 2.2.RC1
JSF 2.0
Facelets
Bea Weblogic 10.3.3
EJB 3.1
Hibernate ORM

callahan
Posts: 768
Joined: 27 May 2010, 22:52

01 Oct 2010, 21:34

Hi,

What scope does taskListBean have. If its RequestScoped, try with ViewScoped to see if it helps.

tassos
Posts: 22
Joined: 01 Oct 2010, 10:50

04 Oct 2010, 12:10

Thanks for the advice Callahan but unfortunately.. it didn't work..
It still responds only to the first selection and does nothing afterwards..

Any other idea... ?

Thanks.
Primefaces 2.2.RC1
JSF 2.0
Facelets
Bea Weblogic 10.3.3
EJB 3.1
Hibernate ORM

tassos
Posts: 22
Joined: 01 Oct 2010, 10:50

04 Oct 2010, 16:49

Dear all,

Some more information to make my issue more clear...
When I visit the page for the first time I am able to make one selection in a row and see my update panel to be updated correctly.
This happens only the first time after the page is loaded! If I attempt to select another row no action is triggered!
The setter method of the selected item is not called, no change in the update panel, nothing at all....
The selected rows are highlighted but no ajax calls are triggered and no setter methods are called.

Has anyone something to propose?? :/

Thanks.
Primefaces 2.2.RC1
JSF 2.0
Facelets
Bea Weblogic 10.3.3
EJB 3.1
Hibernate ORM

healeyb
Posts: 365
Joined: 07 Apr 2010, 16:05

07 Oct 2010, 12:13

I also have this problem with 2.0.2 - the component seems to freeze.
I'm using view scoped beans and can select a row and see the setter
firing for the selection= property. If I then navigate to a different page
(i.e. select a row, hit an edit button) then return to the page with the
datatable (using browser back button in my incomplete code) I can continue
to select rows (i.e. they are highlighted) but the selection= setter method
is not called.

I guess the plan is to try it with 2.2?

Regards,
Brendan.
Last edited by healeyb on 07 Oct 2010, 12:20, edited 1 time in total.

tassos
Posts: 22
Joined: 01 Oct 2010, 10:50

07 Oct 2010, 12:20

Hello Brendan,

It works fine on 2.2.M1 version. I was a little bit reluctant to use a not final version, but 2.1's problems left me no choice.
Hope it will work for you too...

Regards,
Tassos.
Primefaces 2.2.RC1
JSF 2.0
Facelets
Bea Weblogic 10.3.3
EJB 3.1
Hibernate ORM

healeyb
Posts: 365
Joined: 07 Apr 2010, 16:05

07 Oct 2010, 12:27

Hi Tassos, that's good news. I think I'm going to wait for the next
release before giving 2.2 a try.

Regards,
Brendan.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests