8 Replies Latest reply on May 20, 2011 5:06 AM by Stefano Barretta

    IllegalArgument get RowData and rowIndex -1

    Stefano Barretta Newbie

      Hi guys,

      I have a problem with the tag rich:dataTable where in it has value as a column that has an EL expression on my pageCode with a methodthat calls the method 'getRowData()' of 'HtmlDataTable'.


      I have a list of 8 items, but in the method 'getQuotaCapitale ()' lifecycle enter 10 times by having a

      'rowIndex = -1' and therefore an IllegalArgumentException because the row is not available.

      Why do this?

      I printed in console the variable rowIndex and rights cycled from 0 to 7, but falls in method 2 more times to no avail.

      Please help me, I don't know what else to do.



      P.S: i used richfaces 3.1.6 GA under webspheare application server 6.1 and jsf 1.1


      The code below will explain the problem better:



      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
      <rich:dataTable id="dataTable" value="#{test.rateList}" var="rataVar" >
                <h:outputText value="#{test.quotaCapitale}" />



      here Test.java (scope request)

      import org.richfaces.component.html.HtmlDataTable;
      public class Test extends PageCodeBase {
                private List<Long> rateList;
                private BigDecimal quotaCapitale;
                public List<Long> getRateList() {
                          List<Long> longList = new ArrayList<Long>();
                          for (int i = 0; i < 8; i++) {
                                    longList.add(new Long(i));
                          rateList = longList;
                          return rateList;
                public Long getQuotaCapitale(){
                                    HtmlDataTable dataTableRate = (HtmlDataTable)PageCodeBase.findComponentInRoot("dataTable");
                                    Long rata = (Long)dataTableRate.getRowData();
                                    return rata;