Details
-
Type: Bug
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 3.3
-
Fix Version/s: None
-
Component/s: ACE-Components
-
Labels:None
-
Environment:Glassfish 3.1.2.2
Description
Maybe depends on Ticket ICE-9510.
Running the sample code below no item is selected initially.
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.model.SelectItem;
@ManagedBean
@SessionScoped
public class Bean {
private String value = "Three";
private List<SelectItem> items = java.util.Arrays.asList(new SelectItem("One") ,new SelectItem("Two"), new SelectItem("Three"));
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public List<SelectItem> getItems() {
return items;
}
public void setItems(List<SelectItem> items) {
this.items = items;
}
}
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ace="http://www.icefaces.org/icefaces/components"
xmlns:h="http://java.sun.com/jsf/html">
<h:head></h:head>
<h:body>
<h:form>
<ace:selectMenu value="#{bean.value}">
<f:selectItems value="#{bean.items}"/>
</ace:selectMenu>
<h:inputText />
</h:form>
</h:body>
</html>
Running the sample code below no item is selected initially.
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.model.SelectItem;
@ManagedBean
@SessionScoped
public class Bean {
private String value = "Three";
private List<SelectItem> items = java.util.Arrays.asList(new SelectItem("One") ,new SelectItem("Two"), new SelectItem("Three"));
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public List<SelectItem> getItems() {
return items;
}
public void setItems(List<SelectItem> items) {
this.items = items;
}
}
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ace="http://www.icefaces.org/icefaces/components"
xmlns:h="http://java.sun.com/jsf/html">
<h:head></h:head>
<h:body>
<h:form>
<ace:selectMenu value="#{bean.value}">
<f:selectItems value="#{bean.items}"/>
</ace:selectMenu>
<h:inputText />
</h:form>
</h:body>
</html>
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
It seems that setting the last item as selected item is not possible programmatically. If the user has selected the last item, it is set in the model, but after reentering the page (refresh F5 or navigating back to the page), the model value is lost, if and only if the last item was selected.