Once you have a binding to the UIData component, you can call the getRowIndex method on it.

However using binding and accessing UIData objects directly is not generally necessary. I suggest you find a book or article on using JSF tables to see if there is a better solution for whatever it is you are trying to achieve via this "weekIndex" value.

Regards,

Simon

kal stevens wrote:
I wanted the integer to be accessible through my java code.
I could make it a UIData I guess.
But because the "Value" in the table was a list of integers, I wanted to bind the value over which I am iterating to my bean.
I also tried

<x:inputHidden value=#{row} binding="#{pgb.weekIndex}"/>

Is that not supported? is there a better way of doing it?
I assumed that because my value was a List<Integer>, that the variable "row" would be an Integer, and I could bind it to my bean.

Thanks

On 2/6/07, *Simon Kitching* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    kal stevens wrote:
     > Could someone help me out and tell me what is wrong with this
     > I am trying to bind the current value through the iteration to my
    bean.
     >
     > pgb.weekList is a List<Integer>
     > pgb.weekIndex is an Integer
     > pgb.daysOfWeek is a List<Integer>
     >
     >
     >         <x:dataTable
     >                  id="listTableView"
     >                  value="#{ pgb.weekList}"
     >                  binding="#{pgb.weekIndex }"
     >                  var="row">

    The binding attribute must point to a method like this:
       public void setXXX(UIComponent component);

    In the case above, a UIData object will be passed to the method, ie the
    object implementing the x:dataTable.

    I have no idea what you are trying to achieve by binding to some
    Integer..

    Regards,

    Simon



Reply via email to