Make use of another UIData
based component wherein you have full control over the output, such as Facelets' ui:repeat
, Tomahawk's t:dataList
or RichFaces' rich:dataList
or a4j:repeat
.
E.g.
<ul>
<ui:repeat items="#{bean.photos}" var="photo">
<li><img src="#{photo.url}" alt="#{photo.title}" /></li>
</ui:repeat>
</ul>
in combination with for example
li {
display: inline;
list-style-type: none;
}
The t:dataList
and rich:dataList
can render <ul>
and <li>
for you. You just have to print the <img>
(or h:graphicImage
if you prefer that) and apply a shot of CSS.
Update: as a bonus and as horizontally scrolling the page is generally bad for UX, you'd like to make it a carousel. Just style the <ul>
element as follows then:
ul {
width: 500px; /* Just pick whatever width it needs to be. */
white-space: nowrap;
overflow-x: scroll;
overflow-y: none;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…