Ok, it sounds like dataTable might be the wrong tag for me.
I have Core JavaServer Faces, but I did not see how to do this.

I am basically trying to draw an NxM grid where the grid elements are custom
elements.

I tried panelGrid, but unless I misunderstand it can not take in a value or
list to iterate over.
So I tried to use a dataTable, and I was trying to access the nxm element.
That was why I was trying to bind the integer index, because I could not
find another way to get the nxm th element.

I can display my own object if I can get it bound in the right place.

So if in the display of the panel grid, I had a "item" that was bound to my
object when displaying I could do what I wanted.
So lets say that I have an object Person which has a name field.

So this is what I would want to do

<h:panelGrid columns="7" value="${pgb.personBinding}" var="p">
    <h:outputText value="#{p.name}"/>
</h:panelGrid>

To display

harrypetertomsallykathybarbara
Does that make sense?
It sounds like from this discussion that I am doing the wrong thing.
So what am I missing

Thanks

Kal

On 2/6/07, Mike Kienenberger <[EMAIL PROTECTED]> wrote:

> 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">

As you stated, row will indeed successively contain each of the
integers in weekList.
There's a number of ways to get at the current value of row, but you'd
need to tell us what you're hoping to accomplish before we can suggest
a method that will work best in your situation.

As Simon stated, you can always bind the UIData component to your
backing bean, and then call uiData.getRowData().  getRowIndex() will
only give you the table row, and not necessarily the value of your
current integer in the list.



On 2/6/07, kal stevens <[EMAIL PROTECTED]> 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]> 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