p:selectOneMenu in md-inputfield : first option not appearing
Posted: 03 Jun 2020, 13:43
Hi,
I'm using Serenity 2.0.1 and Primefaces 7.0 and I've been enjoying them thoroughly in my project for the past 6 months. However, I've had some issues with p:selectonemenu...
The following code works great:
The following has an issue:
In the second code, the "Select an item" option does not appear in the option list. In fact, if I remove that option altogether, then the first item of MyBean.itemList doesn't appear. It can be pre-selected though, thus appearing as the selected option, but it isn't available in the option list.
This is true both inside and outside a p:dialog, so it isn't related to the similar post: viewtopic.php?f=73&t=57847.
My workaround is to have an extra f:selectItem that is sacrificed to the Primefaces gods, appeasing their wrath and sparing the selectitems I need to render.
Is this a common issue or is my environment somehow jinxed?
Cheers
I'm using Serenity 2.0.1 and Primefaces 7.0 and I've been enjoying them thoroughly in my project for the past 6 months. However, I've had some issues with p:selectonemenu...
The following code works great:
Code: Select all
<div class="ui-g">
<h:form>
<div class="ui-g-12">
<p:selectOneMenu value="#{MyBean.selectedItem}" converter="ItemConverter">
<f:selectItem noSelectionOption="true" itemLabel="Select an item"/>
<f:selectItems value="#{MyBean.itemList}" var="item" itemLabel="#{item.label}" itemValue="#{item}" />
</p:selectOneMenu>
</div>
</h:form>
</div>
Code: Select all
<div class="ui-g">
<h:form>
<div class="ui-g-12">
<h:panelgroup styleclass="md-inputfield">
<p:selectOneMenu value="#{MyBean.selectedItem}" converter="ItemConverter">
<f:selectItem noSelectionOption="true" itemLabel="Select an item"/>
<f:selectItems value="#{MyBean.itemList}" var="item" itemLabel="#{item.label}" itemValue="#{item}" />
</p:selectOneMenu>
</h:panelgroup>
</div>
</h:form>
</div>
This is true both inside and outside a p:dialog, so it isn't related to the similar post: viewtopic.php?f=73&t=57847.
My workaround is to have an extra f:selectItem that is sacrificed to the Primefaces gods, appeasing their wrath and sparing the selectitems I need to render.
Is this a common issue or is my environment somehow jinxed?
Cheers