JSF + Primefaces: Dificuldade para fazer timeline

0 respostas
D

Pessoal,

estou tentando fazer uma timeline vertical, mesmo bem simples, mas não estou conseguindo porque não estou sabendo como agrupar itens que sejam do mesmo ano. Por exemplo, queria que ficasse mais ou menos assim, mas não estou sabendo como fazer:
+ 2000
- teste
- teste 2
- teste 3
+ 2001
+ 2002
- teste 4
- teste 5

Segue uma parte do código que acho importante mostrar:
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:body>
	<ul>
		<ui:repeat value="#{curriculoBean.items}" var="item">
		<li><h:outputText value="#{item.desc}" escape="false"/></li>
		</ui:repeat>
	</ul>
</h:body>
</html>
public class Item {
	
	private int ano;
	private String desc; //descrição
	
	public Item(int ano, String desc){
		this.ano = ano;
		this.desc = desc;
	}
	
	public int getAno() {
		return ano;
	}
	public void setAno(int ano) {
		this.ano = ano;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}

}
@ManagedBean
@ApplicationScoped
public class CurriculoBean {
	
	private List<Item> items = new ArrayList<Item>();

	public List<Item> getItems(){
		return items;
	}
}
Criado 20 de julho de 2014
Respostas 0
Participantes 1