Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

JSF SelectManyMenu Example

7 total views, 7 views today

JSF Selectmanymenu Example

The JSF SelectManyMenu renders an HTML

JSF SelectManyMenu


h:selectManyMenu value=“#{user.color}”>

f:selectItem itemLabel=“Blue” itemValue=“Blue” />

f:selectItem itemLabel=“Green” itemValue=“Green” />

f:selectItem itemLabel=“Red” itemValue=“Red” />

h:selectManyMenu>

HTML





JSF h:SelectManyMenu Example

The below JSF has a where the value is bound to the backing bean class. By default.




Below is the backing bean class

package com.catgovind;

import javax.faces.bean.ManagedBean;

@ManagedBean
public class User {

	private String color[]=new String[]{"Red"};

	public String[] getColor() {
		return color;
	}

	public void setColor(String[] color) {
		this.color = color;
	}
	
	public void printSelectedColors(){
		System.out.println("Selected Colors");
		for(String color: getColor()){
			System.out.println(color);
		}
	}
}

This is how the page looks like in the browser. As you see below, The SelectManyMenu display only one item 


Download Project

  SelectManyMenu_Example


This post first appeared on Oracle ADF, BPM, BI And Primavera P6 Tutorials, please read the originial post: here

Share the post

JSF SelectManyMenu Example

×

Subscribe to Oracle Adf, Bpm, Bi And Primavera P6 Tutorials

Get updates delivered right to your inbox!

Thank you for your subscription

×