aspose file tools*
The moose likes JSF and the fly likes Array of Object in DataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Array of Object in DataTable" Watch "Array of Object in DataTable" New topic
Author

Array of Object in DataTable

Syed Saifuddin
Ranch Hand

Joined: Sep 01, 2003
Posts: 130
Hi EveryBody!

I am getting problem in setting value in the field of object that is displaying in the dataTable.

Manage Bean Code is
--------------------
public class MBGenerateInvoice {
private ListGT[] listGTs = null;

public ListGT[] getListGTs() {
return listGTs;
}
public void setListGTs(ListGT[] listGTs) {
this.listGTs = listGTs;
}
}


Page Code is
------------
<h:dataTable id="ticket" value="#{generateInvoice.listGTs}" var="tbean">
<h:column>
<f:facet name="header">
<hutputText id="ticketnumberText" value="Ticket Number"/>
</f:facet>
<hutputText id="ticketnumber" value="#{tbean.ticketNumber}"/>
</h:column>

<h:column>
<f:facet name="header">
<hutputText id="passengerText" value="Passenger Name"/>
</f:facet>
<hutputText id="passenger" value="#{tbean.passengerName}"/>
</h:column>

<h:column>
<f:facet name="header">
<hutputText id="ticketvalueText" value="Ticket Value"/>
</f:facet>
<hutputText id="ticketvalue" value="#{tbean.ticketValue}"/>
</h:column>

<h:column>
<f:facet name="header">
<hutputText id="taxesText" value="Taxes"/>
</f:facet>
<hutputText id="taxes" value="#{tbean.taxes}"/>
</h:column>

<h:column>
<f:facet name="header">
<hutputText id="commissionText" value="Commission"/>
</f:facet>
<h:inputText id="commission" size="3" value="#{tbean.commission}"/>
</h:column>
</h:dataTable>

Here in the page code last column is "commission" which is input type.
When on the page I change its value. It is not automatically set to the bean.

and when any validation error occur it goes to the initial state.

Please try to solve my problem.
Thank You
Best Regards
Syed Saifuddin


Thank You & Best Regards,

Syed Saifuddin,
Senior Software Engineer

SAP Oracle AIX & Java Training
http://www.socialinet.com
 
wood burning stoves
 
subject: Array of Object in DataTable