Strange rules of Primefaces's Selectonemenu

Source: Internet
Author: User

<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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.