0

I want to use this generic converter in all <p:selectOneMenu /> but it doesn't show data and I have no exceptions.

I don't know the problem

<p:selectOneMenu id="articles-type" style="margin-right:20px;"
                 converter="entityConverter"
                 value="#{newsessionVentesMB.selectedTypeFiltre}">
    <f:selectItem itemLabel="Selectionner Type" itemValue="" />
    <f:selectItems itemLabel="#{t.libelle}" itemValue="#{t}"
                   value="#{newsessionVentesMB.listTypes}" var="t" />
</p:selectOneMenu>

How can I achieve this?

Community
  • 1
  • 1
simonTifo
  • 307
  • 3
  • 12
  • 29

2 Answers2

0

if your f:selectItems does not print any option, try to:

  1. check #{newsessionVentesMB.listTypes}
  2. remove converter
  3. change from p:selectOneMenu to h:selectOneMenu

only for debug purpose.

without any info on how newsessionVentesMB.listTypes is implemented this is the best i con do...

Michele Mariotti
  • 7,372
  • 5
  • 41
  • 73
0

I solved the problem by putting noSelectionOption="true" on the empty selectItem like this:

<f:selectItem itemLabel="Selectionner Type" itemValue="" noSelectionOption="true" /> 

I hope this helps.

alexb83
  • 191
  • 2
  • 8