Let's suppose you have 5 fields and want to display them when you click a button or enter a shortcut.
No Bean
you make a counter, every click on the button increments + 1. Then on inputText
you put a rendered = "bean.contador == 1"
and so on. Then it makes a button that when clicked takes the counter and decreases 1.
It would look like this:
<p:inputText size="40" rendered="ClienteBean.contador == 1" />
<p:inputText size="40" rendered="ClienteBean.contador == 2" />
<p:inputText size="40" rendered="ClienteBean.contador == 3" />
ClientBean:
private Integer contador=0;
//Get and Set's
public void adicionaCampo(){
contador++;
//Adiciona elemento na lista
}
public void removeCampo(){
contador--;
//Remove elemento da lista
}
Then just call these methods on a button or a <p:hotkey>
.