Items from p: selectOneMenu / do not appear

0

I'm developing a web application and jsf web jfs primefaces, and I put a select from primefaces, but the items from <f:selectItems / > do not appear

Looks like this

<h:panelGrouplayout="block" styleClass="parcelas">
                       <p>Parcelas:</p> <p:selectOneMenu id="tamanhos" value="#{parcela.parcelas}" styleClass="tamanho" effect="fold" editable="true">
        <f:selectItem itemLabel="Selecione " itemValue=""/>
        <f:selectItems value="#{parcela.Parcelas()}"/>
    </p:selectOneMenu>
                     </h:panelGroup>   

                       <h:panelGroup layout="block" styleClass="tamanho">
                       <p>Tamanho:</p> <p:selectOneMenu id="tamanhos" value="" styleClass="tamanho" effect="fold" editable="true">
        <f:selectItem itemLabel="Selecione " itemValue=""/>
        <f:selectItems value="#{tamanho.Tamanhos()}"/>
    </p:selectOneMenu>

        </h:panelGroup>

         @ManagedBean(name="tamanho")
       @RequestScoped
       public class Tamanho {

     private Map<String,String> tamanhos = new HashMap<String, String>();


private String tamanho;

public  Map<String, String> Tamanhos(){

tamanhos = new HashMap<String, String>();
    tamanhos.put("PP", "PP");
   tamanhos.put("P","P");
    tamanhos.put("M","M");
    tamanhos.put("G","G");
    tamanhos.put("GG","GG");

    return tamanhos;
    } 

public String getTamanho() {
    return tamanho;
}

public void setTamanho(String tamanho) {
    this.tamanho = tamanho;
}
}


@ManagedBean(name="parcela")
@RequestScoped
public class Parcelas {

private int parcelas;

 private Map<Integer,Integer> parcela= new HashMap<Integer,Integer>();



 public  Map<Integer, Integer> Parcelas(){

parcela = new HashMap<Integer, Integer>();
    parcela.put(1, 1);
    parcela.put(2, 2);
      parcela.put(3, 3);
        parcela.put(4, 4);
          parcela.put(5, 5);
            parcela.put(6, 6);
              parcela.put(7, 7);

          parcela.put(8, 8);
            parcela.put(9, 9);
              parcela.put(10,10);
                parcela.put(11,11);
                  parcela.put(12, 12);

    return parcela;
    } 






public int getParcelas() {
    return parcelas;
}

public void setParcelas(int parcelas) {
    this.parcelas = parcelas;
}

}
    
asked by anonymous 10.07.2017 / 02:32

1 answer

0

Try to see if that does not solve your problem ...

<f:selectItems value="#{tamanho.Tamanhos}" var="t" itemValue="#{t.key}" itemLabel="#{t.value}"/>

Anything you take a look at this link, I think it might help you. link

    
10.07.2017 / 03:47