| Author |
tr:selectManyShuttle - display disabled
|
hassan ali
Ranch Hand
Joined: Apr 23, 2006
Posts: 127
|
|
i run example in jsf component book about trinidad for tr:selectManyShuttle it apper disabled i dont know why.
i got this messge in render file
<script type="text/javascript">var _AdfWindowOpenError='A popup window blocker has been detected in your browser. Popup blockers interfere with the operation of this application. Please disable your popup blocker or allow popups from this site.';</script>
while 100% popup blocker closed
kindley help me to run this component
this is manged bean file
import java.util.ArrayList;
import java.util.List;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
public class productBean {
List allEmployees =null;
List selectedEmployees =null;
List Names= null;
public List getselectedProducts(){
if (selectedEmployees == null) {
selectedEmployees = new ArrayList<javax.faces.model.SelectItem>();
}
return selectedEmployees;
}
public void saveSortedProducts(ActionEvent actionEvent) {
List l = this.getselectedProducts();
StringBuilder text = new StringBuilder("Size = ").append(getselectedProducts().size()).append(", Items added are: ");
for (int i = 0; i <l.size(); i++ ) {
text.append("Item ").append(i).append(" = ").append(l.get(i)).append(", ");
}
FacesContext fctx = FacesContext.getCurrentInstance();
FacesMessage message = new FacesMessage(text.toString());
fctx.addMessage(null, message);
}
public void setproductSelectItems(List n){
Names = new ArrayList><javax.faces.model.SelectItem>();
Names=n;
}
public List getproductSelectItems(){
if (allEmployees == null) {
allEmployees = new ArrayList<javax.faces.model.SelectItem>();
allEmployees.add(new javax.faces.model.SelectItem("Employee 1"));
allEmployees.add(new javax.faces.model.SelectItem("Employee 2"));
allEmployees.add(new javax.faces.model.SelectItem("Employee 3"));
allEmployees.add(new javax.faces.model.SelectItem("Employee 4"));
allEmployees.add(new javax.faces.model.SelectItem("Employee 5"));
allEmployees.add(new javax.faces.model.SelectItem("Employee 6"));
}
return allEmployees;
}
}
this jsf file
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr" %>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<f:view>
<tr:form>
<tr:selectManyShuttle id="shuttle" label="Selected Values"
leadingHeader="Available values:"
trailingHeader="Selected values:"
value="#{productBean.selectedProducts}" disabled="false">
<f:selectItems value="#{productBean.productSelectItems}" />
</tr:selectManyShuttle>
<tr:commandButton text="Submit"
actionListener="#{productBean.saveSortedProducts}" />
<tr:message for="shuttle" />
</tr:form>
</f:view>
</body>
</html>
|
 |
hassan ali
Ranch Hand
Joined: Apr 23, 2006
Posts: 127
|
|
i found it
shuttl component need function to save choises at and it was this
public void setselectedProducts(List l){
selectedEmployees=l;
}
|
 |
 |
|
|
subject: tr:selectManyShuttle - display disabled
|
|
|