just a comment,
if you are making a menu containing a list of options, you should use the 'ul' or 'ol' tag, so that the code is 'semantically correct' as far as I know, there is no standard component to achieve this, but it should be really easy to build such one and I'm sure at least you could find one on the net

At 18:20 20/06/2005, you wrote:
I have been trying to use c:forEach in my jspx pages but I keep experiencing different kinds of problems. An example:

        <c:forEach items="${treeMenuContractBean.menuItems}" var="menuItem">
            <div style="margin-left: ${menuItem.marginLeft}">
                <c:out value="${menuItem.prelude}"/>
<h:outputLink title="#{menuItem.name}" value="#{menuItem.uri}">
                    <c:out value="${menuItem.name}"/>
                </h:outputLink>
                <c:out value="${menuItem.postlude}"/>
            </div>
        </c:forEach>

When this is run, I get

<a id="tree-menu-contract:_id1" href=""></a>
<a id="tree-menu-contract:_id2" href=""></a>
<div style="margin-left: 0px">The name of menu item 0</div>
<div style="margin-left: 50px">The name of menu item 1</div>
Now as you can see this result has several problems:
* The #{} value bindings have no effect - it is as if the menuItem var is invisible to JSF, thus the href attribute is empty * The div tags do not surround the anchor tags as intended - is it really a requirement to use the x:div tag? So I have been thinking that maybe using c:forEach is not compatible with JSF - is there an alternative?

Any hints will be highly appreciated.


Randahl

Reply via email to