Andrew Robinson schrieb:
Andrew, can you give an example of when it could be used?

Check the documentation and the demo

http://example.irian.at/example-sandbox-20080702/limitRendered.jsf
http://myfaces.apache.org/sandbox/tlddoc/s/limitRendered.html

It states its purpose as a JSF substitute for
c:choose/c:when/c:otherwise to avoid JSP tag logic in JSF pages.
I did read the javadoc that says this is "a substitute for c:choose". But that wasn't helpful to me. In what kind of real-world page would I want to choose to render the first 3 children? Or child 4 and 7?

The example page doesn't help much. It is demonstrating the functionality, not showing a real use case.

I can possibly see wanting to render one specific child from a set. But even then, would I really want to specify which child via an *integer offset*? That seems to very tightly couple the page layout to the backing bean. Adding a new child component or rearranging them shouldn't affect *which ones* are rendered, but that's what an index-based approach to child selection will do.

The traditional approach of a rendered attribute on each child that queries whether *it* needs to be rendered might be a little more verbose, but seems to provide a much more stable division between page and backing bean than having a backing bean method that returns a list of indexes into the child list.

You must have had a real use case that pushed you to write this component. Can you please describe it?

Regards,
Simon

Reply via email to