On Mon, 17 Jan 2005 12:29:01 -0800 (PST), Ray Clark
<[EMAIL PROTECTED]> wrote:
> Thanks Sean.  I guess I did misunderstand your point.
> I have looked at the source for dataTable a little and
> did find it usefull for fixing a different problem
> that I was having.  I'll dig in to it more to see if I
> can come up with something.
> 
> It's a shame that they didn't make the dataTable more
> flexible to begin with.
> 
> I'll keep trying.  I'm not giving up on myFaces and
> JSF.
> 

For folks who think they might need a customized renderer for the
UIData component (perhaps to create some markup other than a table),
the JSF RI comes with some demos -- one demo in particular is a
"Repeater" renderer for UIData that is very easy to subclass and
extend.  It has convenient protected methods for things like the
beginning and end of each "row" where you just need to create your own
markup instead of the default.

Download from:

    http://java.sun.com/j2ee/javaserverfaces/download.html

and then check out
"samples/components/src/java/components/renderkit/RepeaterRenderer.java"

This is a standard JSF renderer, so it should work on top of MyFaces
as well as the RI.

> Thanks,
> Ray
> 

Craig


> --- Sean Schofield <[EMAIL PROTECTED]> wrote:
> 
> > I think you misunderstood.  We're not suggesting
> > that you have to use
> > <h:dataTable>.  You're free to use your own custom
> > component if
> > dataTable is not doing it for you.
> >
> > The suggestion is that you look at how h:dataTable
> > is implemented in
> > the MyFaces code.  There are basic concepts in there
> > that you can use
> > for your own custom coponent.
> >
> > The main thing is that in dataTable, you iterrate
> > over the data, not
> > the rows.  The rows get added by the component's
> > renderer.  In the JSP
> > you just say what goes in the columns and the rows
> > will be generated
> > as the data is being iterrated over.
> >
> > I'm relatively new to JSF so I can't give you the
> > specifics but I did
> > learn a little about it when I was implementing
> > forceId so that it
> > could work on components contained in tables, etc.
> >
> > Just check out the source code and follow along.  It
> > will be a good
> > exercise in understanding some of the more
> > complicated
> > behind-the-scenes aspects of JSF.  No need to panic
> > and drop JSF ;-)
> > You will definitely be able to do what you need with
> > what is
> > available.
> >
> >
> > sean
> >
> > On Mon, 17 Jan 2005 12:08:46 -0800 (PST), Ray Clark
> > <[EMAIL PROTECTED]> wrote:
> > > Thanks for your response.
> > >
> > > I don't think that I can use h:dataTable for my
> > > situation.  We have pages that have JSTL ifs
> > around
> > > the rows so that the rows only show up sometimes
> > based
> > > on the data in the list.  For instance, if I want
> > an
> > > <hr> tag when a control break occurs.  I didn't
> > want
> > > to put smarts in the renderer to check the data in
> > the
> > > list that was specified.  So if I could get the
> > row
> > > tag to work then I could use the standard rendered
> > > attribute on the row for this.  That makes the
> > > component generic and simple, and yet makes the
> > custom
> > > tags powerful enough to produce any type of table
> > that
> > > needs to be generated.
> > >
> > > In addition to the rows only being rendered
> > sometimes,
> > > what about multi line column headings?  I couldn't
> > get
> > > that to work with the h:dataTable because the
> > facet
> > > tag didn't seem to want to render the second tag.
> > >
> > > Not to mention that the dataTable tag doesn't
> > support
> > > rowspan and colspan which I need to emulate the
> > tables
> > > that we produce at work.
> > >
> > > So I'd like to get the row tag to work if I can.
> > If I
> > > can't find a way around this then JSF is out for
> > us.
> > >
> > > I can't believe that there isn't a way to do this
> > > somehow.
> > >
> > > Thanks for your thoughts.
> > >
> > > Ray
> > >
> > > --- Martin Marinschek
> > <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > that is exactly the problem - use the specific
> > JSF
> > > > iterator tags
> > > > (specification: h:dataTable, MyFaces
> > Implementation
> > > > additionally:
> > > > x:dataList) when doing iterations; else you run
> > into
> > > > problems all
> > > > over...
> > > >
> > > > regards,
> > > >
> > > > Martin
> > > >
> > > >
> > > >
> > > > On Mon, 17 Jan 2005 12:00:52 -0500, Sean
> > Schofield
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > I'm not sure about the specifics of your
> > custom
> > > > component so its hard
> > > > > to say.  One thing that looks strange to me
> > > > though, is your use of a
> > > > > "row" tag.  Typically you do not need such a
> > tag.
> > > > In <h:dataTable>
> > > > > for instance, you only specify the columns and
> > the
> > > > component
> > > > > automatically generates the rows as it
> > iterrates
> > > > over the data.
> > > > >
> > > > > sean
> > > > >
> > > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > The all-new My Yahoo! - What will yours do?
> > > http://my.yahoo.com
> > >
> >
> 
>                 
> __________________________________
> Do you Yahoo!?
> All your favorites on one personal page â Try My Yahoo!
> http://my.yahoo.com
>

Reply via email to