0

I have a datatable with an input field on each row. I need to know how to get the cost values entered on each row when a save button is pressed?

          <p:dataTable value="#{eventCreateEditCostModel.costEntities}" var="eventCost"
                             rowKey="#{eventCost.eventCostId}"
                             sortMode="multiple"
                             resizableColumns="true"
                             widgetVar="eventCostTable"
                              rows="10">
                    <f:facet name="header">
                        Event Costs Listing
                    </f:facet>
                    <p:column headerText="ID">
                        <h:outputText value="#{eventCost.eventCostId}" />
                    </p:column>
                    <p:column headerText="Name">
                        <h:outputText value="#{eventCost.name}" />
                    </p:column>
                    <p:column headerText="Cost">
                        <pe:inputNumber value="#{eventCost.cost}" decimalPlaces="2" label="Cost"
                                        minValue="0" maxValue="999999999" thousandSeparator="true" title="Cost" symbol="$"/>
                    </p:column>

                </p:dataTable>
snafua
  • 75
  • 1
  • 14
  • Solution explained at – శ్రీ Dec 22 '15 at 04:00
  • What exactly is your problem when you inspect the `costEntities` in the save action method? – BalusC Dec 22 '15 at 09:07
  • costEntities collection will hold the cost values provided pe:inputNumber validation passed. – Mahendran Ayyarsamy Kandiar Dec 23 '15 at 01:34
  • Thanks, my problem is the cost was not being updated during the save. The save button was calling a different mbean as I am using tabs with costentities as being one tab and the save button was for all tabs. Cost entities is not available from a different mbean even though the save button invokes all tabs getters and setters during it's execution. – snafua Dec 23 '15 at 22:20

0 Answers0