WOW thank you very much.
I think the newspaper column is kind of what I was looking for.

We might be able to use the schedule tag, which will make it look much
nicer.

Thanks for your help.

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

By the way, the key class here is
RowAndColumnRelationshipsBackingBean.java.   This is how your backing
bean would be configured, with t:dataTable's value being your
rowDataModel and t:columns's value being your columnDataModel.

I have some more modern code using Facelets compositions rather than jsp:

          <t:dataTable id="datatable"
                       value="#{backingBean.rowDataModel}"
                       var="row"
                       rows="10"
                       preserveDataModel="false"
                       border="1">
            <f:facet name="footer">
                <h:panelGroup>
                    <h:commandButton value="Update"
actionListener="#{backingBean.update}"/>
                </h:panelGroup>
            </f:facet>
            <h:column>
                <h:outputText value="#{row.rowName}"/>
            </h:column>
            <t:columns
                value="#{backingBean.columnDataModel}"
                var="column">
              <f:facet name="header">
                <h:outputText value="#{column.columnName}"/>
              </f:facet>
              <h:selectBooleanCheckbox
value="#{backingBean.relationshipValue}"/>
            </t:columns>
          </t:dataTable>

Implement your own RowAndColumnRelationshipsDataModel instances.

On 2/6/07, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> No, t:dataTable and t:columns is the right approach.
>
> However, you probably need to bind both UIData components to your
backing bean and call getRowData() on both to determine what to do.
>
> You can take a look at this ancient piece of code I wrote a couple of
years ago that populates an nXm grid of checkboxes:
>
>
http://issues.apache.org/jira/secure/attachment/12311217/RowAndColumnRelationshipComponent.zip
>
> Not everything in here is probably relevent to your situation (I was
trying to write a custom component that handled the entire grid by
compositing a bunch of components together in java code).
>
> However, the backing model should show you what you need to do.
>
> It's also possible that there's a far easier way to do what you're tying
to do.
>
> If you're just trying to wrap an arbitrary number of elements, look into
using the newspaperColumn attributes to turn an nX1 list of data into a
nXconstant matrix of data.
>
> You might also look at the t:schedule component since it sounds like
you're really trying to do some kind of calendar work :-)
>
>
>
>
>
> On 2/6/07,  kal stevens <[EMAIL PROTECTED]> wrote:
> >  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
> >
> >
> > harrypetertom
> > sallykathybarbara
> >  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