<p:selectOneMenu>
<f:selectitems value= "Beanproperty"/>
<p:column>
</p:column>
</p:selectOneMenu>
When you use P:column to create columns in the Selectonemenu, you will find that the column of this control is not perfect, first of all, Beanproperty cannot be a string array, such as
String[] str={"1", "2"}
<p:selectOneMenu>
<f:selectitems value= "Class.str"/>
<p:column>
</p:column>
</p:selectOneMenu>
After this binding, the column cannot be created, which
If you bind a variable of type list, then you specify the format
<p:selectonemenu var= "Y" >
<f:selectitems value= "Beanproperty" var= "x" Itemlabel=#{x.name} itemvalue= "#{x.name}"/>//name property is a string
<p:column>
#{y.name}
</p:column>
</p:selectOneMenu>
Code like this does not take effect, does not create columns, and does not specify column
If you specify this
<p:selectOneMenu>
<f:selectitems value= "Beanproperty" var= "x" Itemlabel=#{x.name} itemvalue= "#{x}"/>//name property is a string
</p:selectOneMenu>
If you specify this, you will see that the drop-down list shows the ToString () return value for each variable
<p:selectonemenu var= "Y" >
<f:selectitems value= "Beanproperty" var= "x" Itemlabel=#{x.name} itemvalue= "#{x}"/>//name property is a string
</p:selectOneMenu>
But if you specify this, just add a var= "Y", you will find that the drop-down list is unable to display the data, that is, the drop-down button, the drop-down list will not appear correctly, the display of a very small white box
<p:selectonemenu var= "Y" >
<f:selectitems value= "Beanproperty" var= "x" Itemlabel=#{x.name} itemvalue= "#{x}"/>//name property is a string
<p:column>
#{y.name}
</p:column>
</p:selectOneMenu>
But if you specify this, the effect you want will appear, the column is created correctly, but it's all just in Firefox .....
If you are under IE, you may be wrong, why is it possible, because sometimes correct, error phenomenon, the drop-down list is very far away from the correct location, the drop-down list is very wide, basically occupy the rest of the space
I think that this is a bug in Primefaces, the current primefaces5.1 Community Edition, did not fix this error.
So, if you need to use a drop-down list, don't create columns with column.
Strange rules of Primefaces's Selectonemenu