Thatnks for the feedback, I think I will rename it to avoid confusion since it isn't the same as c:choose. Perhaps something like selectiveRenderer or limitRendered?
On 6/15/07, Gary VanMatre <[EMAIL PROTECTED]> wrote:
>From: "Mike Kienenberger" <[EMAIL PROTECTED]> > > Andrew, > > I'm not an expert on c:choose, but from the one time I tried to use > it, the syntax and functionality seemed quite different. > > If there's going to be a sandbox:choose component, I would hope that > it would be the render-time equivalent of the c:choose build-time tag. > > Since I don't think that's the case, I'd recommend using a different > name for this component. > > Otherwise, it's going to cause a great deal of unnecessary confusion. > Yeah, it's more like the java.text.ChoiceFormat class. Although, it seems like a handy component. > How about "chooseRendered"? > > > On 6/14/07, Andrew Robinson wrote: > > I am working on the code for a very simple component, but wanted to > > see if there is feedback before finishing it up. > > > > The component is inspired by the JSTL choose but is geared for JSF and > > is more robust. I thought this would be helpful when a lot of facelets > > developers complain about the facelets implementation of choose due to > > render vs. compile time evaluation. > > > > > > > > type := index|count (default: count) > > value := (type == index): list of numbers that correspond to children > > indexes (negatives allowed). Default: render all > > (type == count): integer representing max number of c ompone nts to > > render. Default: render first > > > > Examples: > > > > > > > > > > > > Renders: b > > > > > > > > > > > > > > > > Renders: b c > > > > > > > > > > > > > > > > Renders: b c d > > > > > > > > > > > > > > > > Renders: a d > > > > > > > > > > > > > > > > Renders: a d > > > > > > > > > > > > > > > & gt; Throws index out of bounds exception > > > > If index, value can be tied to one of: > > Collection of Number or Object > > int[] > > Object[] of Number or Object > > String or Object (comma-separated toString()) > > > > If Object and not a Number, Integer.parseInt(obj.toString()) is used. > > > > The default setting is really the most useful (type=count, value=1), > > which is simply render only the first child component that > > isRendered() returns true. > > > > > > Any feedback? > > -Andrew > >
