myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wolf Benz" <>
Subject t:selectItems behavior (MF 121 - Facelets1.1.13 - Tomahawk Sandbox 2.0)
Date Mon, 29 Oct 2007 10:23:20 GMT
Has someone else had trouble with t:selectItems behavior?
I have the below code in my page. The setup is: a user account name is
picked from a selctOne menu, which has as effect the user is digged up
from the DB, a variable "person" is set in the UserBean (JSF bean) and
this person's fields are then shown under the Menu to update.

<t:selectOneMenu id="personMenu" value="#{userMgmtBean.person.account}"
             onchange="submit()" immediate="true">
    <f:selectItem itemLabel="Choose One" itemValue="choose_one" />
    <t:selectItems value="#{utilBean.persons}" var="person"
         itemValue="#{person.account}" >

The referenced listener method, "chooseUserTrigger" of UserBean, digs
up the User from the DB.

public void chooseUserTrigger(ValueChangeEvent event){
		FacesContext ctx = FacesContext.getCurrentInstance();
		String gekozenGebruiker = event.getNewValue().toString();	// = the
User's NT Account"The Chosen Person, is "+ gekozenGebruiker);
		if(gekozenGebruiker.equalsIgnoreCase("choose_one"))		// --> no valid
Action has been chosen but "Choose One"
			// Do nothing & Exit this loop.
		// A real user was chosen -> dig up all his data:
		try {
			// First check: Selected user in DB?
			// If Person is still null, show error:
			if(getPerson() == null){	// tell the user no such person was found
				ctx.addMessage("userMgmtForm", new
			if(getPerson() != null)"The Person we found, has these
data: "+ person.toString());
		} catch (PersistenceException e) {
			ctx.addMessage("userMgmtForm", new

The problem:
Although the logging("The Person we found, has these data...") shows
the correct user with the correct info was digged up, in a blik of an
eye, the menu filled with users, refills itself, by itself, with
null-items. In the loggings, I also see the person's method setWWID()
is called with a null value. (shouldn't be happening, and certainly
not with a null value; it's WWID - world Wide ID. Certainly my code is
NOT calling it)

Anyone experienced the same probs/has an idea on how to remedy?


View raw message