myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schneidc <>
Subject MyFaces binding problem with HtmlSelectOneMenu/SelectOneChoice
Date Mon, 25 Jan 2010 13:35:40 GMT


I tried both drop down menus, MyFaces's HtmlSelectOneMenu and Trinidad's
SelectOneChoice and both seem to have the same problem or at least I can't
understand their behaviour.

The menus are bound to an according object in a managed bean and the setter
looks like this:

	public void setSelectOne(CoreSelectOneChoice selectOne) {
		this.selectOne = selectOne;
		if(selectOne.getValue() != null)
			System.out.println("broker null");

the tags:

			<tr:selectOneChoice id="menu0" inlineStyle="margin-left: 20px"
				<tr:selectItem label="Broker" value="broker" />
				<tr:selectItem label="Customer" value="customer" />

The very first time I call a page I get "broker null" as expected. Then I
push a button which causes a submit and the setter get's called again but
although I SELECTED a value I still get "broker null". When I push the
button a second time I finally get a not null value.

And if it wasn't confusing enough the behaviour differs from App Server to
App Server. The above behaviour was observed on a Websphere App Server. On a
Glassfish instead I get "broker null" when the page is called for the first
time (ok so far) and when I hit a button
"broker null"
"broker != null"
as output straight one after another.

Can somebody explain to me this behaviour? Especially why I only get a not
null value on the WAS after causing a submit a second time?

View this message in context:
Sent from the MyFaces - Users mailing list archive at

View raw message