Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b:selectOneMenu, f:selectItem value is ignored #780

Closed
NicolaIsotta opened this issue May 15, 2017 · 1 comment
Closed

b:selectOneMenu, f:selectItem value is ignored #780

NicolaIsotta opened this issue May 15, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@NicolaIsotta
Copy link
Contributor

NicolaIsotta commented May 15, 2017

Consider this code:

<h:selectOneMenu label="h:selectOneMenu">
	<f:selectItem value="#{index.selectItem}"/>
</h:selectOneMenu>

<b:selectOneMenu label="b:selectOneMenu">
	<f:selectItem value="#{index.selectItem}"/>
</b:selectOneMenu>

Bean:

@ManagedBean
@ViewScoped
public class Index {
	private SelectItem selectItem = new SelectItem("DDDDD", "DDDDD");

	public SelectItem getSelectItem() {
		return selectItem;
	}

	public void setSelectItem(SelectItem selectItem) {
		this.selectItem = selectItem;
	}
}

The generated HTML is:

<select name="j_idt7" size="1">
	<option value="DDDDD">DDDDD</option>
</select>
<div class="form-group bf-warning has-warning" id="j_idt9">
	<label for="j_idt9Inner" class=" control-label">b:selectOneMenu</label>
	<select id="j_idt9Inner" name="j_idt9Inner" class="form-control">
		<option data-label="&amp;nbsp;">&nbsp;</option>
	</select>
</div>

This happens because the value attribute of f:selectItem is ignored, seems like the code is based on a quite old version of PrimeFaces.

@stephanrauh
Copy link
Collaborator

Thanks for reporting and fixing the bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants