我有一个primafaces ring.I想要用xhtml代码拍摄图像。我有一个论文库包括图像(paper1.jpg,paper2.jpg,.. paper12.jpg)。我不想使用ringview.java.I在p:ring标签之间添加了graphicimage标签。但是我没有显示图像。我该怎么办?
<h:form id="form">
<p:ring id="custom" value="#{ringView.papers}" var="paper">
<p:graphicImage id="img" name="papers/#{paper}" style="width:100%; height:100%"/>
</p:ring>
</h:form>
RingView.java
@ManagedBean
public class RingView implements Serializable {
private List<String> papers;
private String selectedPaper;
@PostConstruct
public void init() {
papers = new ArrayList<String>();
for (int i = 1; i <= 12; i++) {
papers.add("paper" + i + ".jpg");
}
}
public List<String> getPapers() {
return papers;
}
public void setPapers(List<String> papers) {
this.papers = papers;
}
public String getSelectedPaper() {
return selectedPaper;
}
public void setSelectedCar(String selectedPaper) {
this.selectedPaper = selectedPaper;
}
}
我尝试过类似的事情:
<h:form id="form">
<p:ring id="custom">
<p:graphicImage id="img1" name="papers/paper1.jpg" style="width:100%; height:100%"/>
<p:graphicImage id="img2" name="papers/paper2.jpg" style="width:100%; height:100%"/>
<p:graphicImage id="img3" name="papers/paper3.jpg" style="width:100%; height:100%"/>
</p:ring>