0

I am having a simple backing bean:

@Named
@RequestScoped
public class BackingBean {

  public String[] getStorageLocations() {
    return new String[]{"0088", "0016", "0022"};
  }
}

In the xhtml file I am using a <ui:repeat /> tag to output the array of strings from the backing bean:

<ui:repeat value="#{backingBean.storageLocations}" var="location">
  <h:panelGroup layout="block">
    <h:outputText value="#{location}" />
  </h:panelGroup>
</ui:repeat>

What I am expecting is this:

<div>0088</div>
<div>0016</div>
<div>0022</div>

What I acutally receive from JSF is this:

<ui:repeat>0088</ui:repeat>
<ui:repeat>0016</ui:repeat>
<ui:repeat>0022</ui:repeat>

What am I doing wrong?

marius.7383
  • 159
  • 1
  • 12

2 Answers2

1

I am assuming that you are using GF4. This was a bug. Try updating your javax.faces jar with the latest released one.

Ioannis Deligiannis
  • 2,679
  • 5
  • 25
  • 48
  • Thank you, the `` tags are now gone in the html output. But the `` are still not produced. Is this related to the bug in javax.faces.jar? – marius.7383 Oct 25 '13 at 17:34
  • Welcome. I haven't experienced this issue before. To check if this is a bug, try adding a styleClass to the panelgroup. If it doesn't work, I would raise a new question. good luck – Ioannis Deligiannis Oct 26 '13 at 10:13
  • Adding a styleClass worked and produced the div correctly. Thanks again, john d, you saved me a lot of trouble. – marius.7383 Oct 28 '13 at 09:16
1

A simpler solution: change the xmlns url to sun's:

from:

xmlns:ui="http://xmlns.jcp.org/jsf/facelets"

to:

xmlns:ui="http://java.sun.com/jsf/facelets"

(thanks http://blog.coffeebeans.at/?p=775)

Michael Bar-Sinai
  • 2,729
  • 20
  • 27