0

I have a <p:dataTable > which is updated from a button and is also filled. The data is displayed correctly. But the PROBLEM is that when I click/select any row, NO RESPONSE; previously while being clicked, the row was highlighted, now-> no highlight. I have done this type of design many times but this time the <p:dataTable> is behaving weirdly. I cannot find the root of problem.

My XHTML snippet for table is :

<p:dataTable id="tblSales" rowIndexVar="rowsn"
             paginator="true" value="#{invSaleMB.dummyList}"
             var="saleObj" selectionMode="single"
             selection="#{invSaleMB.dummySaleObj}"
             rowKey="#{saleObj.item.itemTypeId}">

    <p:column headerText="#">
        <h:outputLabel value="#{rowsn+1}" />
    </p:column>
    <p:column headerText="Name">
        <h:outputLabel value="#{saleObj.item.itemTypeName}" />
    </p:column>
    <p:column headerText="Count">
        <h:outputLabel value="#{saleObj.count}" />
    </p:column>
    <p:column headerText="Unit Price">
        <h:outputLabel value="#{saleObj.unitPrice}" />
    </p:column>
    <p:column headerText="Total Price">
        <h:outputLabel value="#{saleObj.total}" />
    </p:column>
</p:dataTable>

My backing bean is @ViewScoped.

And another component which is not responding to an update trigger is <pe:inputNumber> and value for this component is 'double'. I changed the <pe:inputNumber> to <p:inputText> and worked well and displayed accurate data.

<pe:inputNumber id="totalCost" disabled="true" value="#{invSaleMB.totCost}" />

The datatable and pe:inputNumber are on same form.

Tiny
  • 27,221
  • 105
  • 339
  • 599
SudeepShakya
  • 571
  • 3
  • 14
  • 34

1 Answers1

0

What have you changed between "before" (was working) and "now" (not working)?. You are sure "#{saleObj.item.itemTypeId}" is unique for each element of the table? More code of the page could be useful.

For pe:inputNumber to work remember to include xmlns:pe="http://primefaces.org/ui/extensions" in your html tag.

  • I have included xmlns:pe="http://primefaces.org/ui/extensions" .And I am sure that #{saleObj.item.itemTypeId} is unique for each element of the table. Nothing has been changed,it was working well.But suddenly some components like pe:inputNumber and p:dataTable stopped responding. For pe:inputNumber, I replaced with p:inputText but for p:dataTable, I don't know other alternative.Before this happened,I tried the row selection events which responded well.I am facing this type of problems more recently.I even posted full html code as a Bounty and BalusC gave me some tips but I didn't understand. – SudeepShakya Dec 17 '14 at 04:57