14 Replies Latest reply on Jan 8, 2008 9:26 PM by Xuan Toan

    Problem with ListShuttle

    Xuan  Toan Newbie

      ListShuttle is slow when click item in source list. Source list has about 2000 item.

      This is my jsp

      <%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
      <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
       <f:view>
       <rich:listShuttle sourceValue="#{TestBean.clipbeans}"
       targetValue="#{TestBean.folder}" var="items"
       sourceCaptionLabel="Kho Clips"
       targetCaptionLabel="Folder" id="idList" sourceListWidth="100%" targetListWidth="100%" rowKeyVar="rowIndex" >
       <rich:column width="20">
       <f:facet name="header">
       <h:outputText value="test" />
       </f:facet>
       <h:outputText value="#{rowIndex}"></h:outputText>
       </rich:column>
       <rich:column width="20">
       <f:facet name="header">
       <h:outputText value="test" />
       </f:facet>
       <h:outputText value="#{rowIndex}"></h:outputText>
       </rich:column>
       </rich:listShuttle>
       </f:view>
      


      My bean

      public class TestBean {
      
       ArrayList clipbeans;
       ArrayList folder;
       /**
       *
       */
       public TestBean() {
       // TODO Auto-generated constructor stub
       clipbeans=new ArrayList(2000);
       folder=new ArrayList(100);
       for (int i=0;i<2000;i++){
       String a=new String("aaa");
       clipbeans.add(a);
       }
       }
       public ArrayList getClipbeans() {
       return clipbeans;
       }
       public void setClipbeans(ArrayList clipbeans) {
       this.clipbeans = clipbeans;
       }
       public ArrayList getFolder() {
       return folder;
       }
       public void setFolder(ArrayList folder) {
       this.folder = folder;
       }
      
      }
      
      

      what can i do to make it runs quickly? Thanks