2 Replies Latest reply on Mar 10, 2008 11:07 AM by Ilya Shaikovsky

    rich:orderingList : it's wrong when i commit the form,who ca

    jessie Newbie

      .jsp source

      <%@include file="/page/common/taglibs.jsp"%>
      <f:view>
       <h:form>
       <rich:orderingList orderControlsVisible="true" var="localFile"
       fastOrderControlsVisible="true"
       selection="#{taskBean.fileListSelected}" value="#{taskBean.fileList}"
       listWidth="250px" listHeight="260px">
       <rich:column width="200px" sortable="false">
      
       <h:outputText value="#{localFile.name}" style="font-size:13px;"></h:outputText>
       </rich:column>
       <rich:column>
       <h:graphicImage value="#{localFile.iconPath}"></h:graphicImage>
       </rich:column>
       </rich:orderingList>
       <h:commandButton actionListener="" value="Delete Selected Ones"></h:commandButton>
       </h:form>
      </f:view>
      




      public class TaskAttachFile {
      
       private String name;
      
       private String path;
      
       private String iconPath;
      
       private String fileType;
      
       /**
       * @return the name
       */
       public String getName() {
       return name;
       }
      
       /**
       * @param name
       * the name to set
       */
       public void setName(String name) {
       this.name = name;
       }
      
       /**
       * @return the path
       */
       public String getPath() {
       return path;
       }
      
       /**
       * @param path
       * the path to set
       */
       public void setPath(String path) {
       this.path = path;
       }
      
       /**
       * @return the iconPath
       */
       public String getIconPath() {
       return iconPath;
       }
      
       /**
       * @param iconPath
       * the iconPath to set
       */
       public void setIconPath(String iconPath) {
       this.iconPath = iconPath;
       }
      
       /**
       * @return the fileType
       */
       public String getFileType() {
       return fileType;
       }
      
       /**
       * @param fileType
       * the fileType to set
       */
       public void setFileType(String fileType) {
       this.fileType = fileType;
       }
      
      }
      
      


      Part sourc of TaskBean
      ......
       private ArrayList<TaskAttachFile> fileList = new ArrayList<TaskAttachFile>();
       private ArrayList<TaskAttachFile> fileListSelected = new ArrayList<TaskAttachFile>();
      .....
      
       /**
       * @return the fileList
       */
       public ArrayList<TaskAttachFile> getFileList() {
      
       if (fileList.isEmpty()) {
       for (int i = 0; i < 10; i++) {
       TaskAttachFile file = new TaskAttachFile();
       file.setFileType("doc");
       file.setIconPath(fileTypeIcon.fileIconRelations.get("doc").toString());
       file.setName("doc document " + i);
       fileList.add(file);
       }
       }
      
       return fileList;
       }
      
      
      


      when i click the button,it's wrong:color]

      root cause

      javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /page/workspace/task/orderlist_test.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp0][Class: org.richfaces.component.html.HtmlOrderingList,Id: _idJsp1][Class: org.richfaces.component.html.HtmlColumn,Id: _idJsp2][Class: javax.faces.component.html.HtmlOutputText,Id: _idJsp3]}
      org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:227)
      org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:69)
      org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:57)
      javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
      org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
      org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
      org.richfaces.renderkit.OrderingListRendererBase.encodeOneRow(OrderingListRendererBase.java:188)
      org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:87)
      org.richfaces.model.OrderingListDataModel.walk(OrderingListDataModel.java:48)
      org.ajax4jsf.component.UIDataAdaptor.walk(UIDataAdaptor.java:994)
      org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:107)
      org.richfaces.renderkit.OrderingListRendererBase.encodeRows(OrderingListRendererBase.java:111)
      org.richfaces.renderkit.AbstractRowsRenderer.encodeChildren(AbstractRowsRenderer.java:139)
      javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:527)
      javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:483)
      javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:364)
      org.apache.jsp.page.workspace.task.orderlist_005ftest_jsp._jspx_meth_rich_005forderingList_005f0(orderlist_005ftest_jsp.java:208)
      org.apache.jsp.page.workspace.task.orderlist_005ftest_jsp._jspx_meth_h_005fform_005f0(orderlist_005ftest_jsp.java:162)
      org.apache.jsp.page.workspace.task.orderlist_005ftest_jsp._jspx_meth_f_005fview_005f0(orderlist_005ftest_jsp.java:130)
      org.apache.jsp.page.workspace.task.orderlist_005ftest_jsp._jspService(orderlist_005ftest_jsp.java:97)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
      org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
      org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
      org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
      org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
      org.apache.myfaces.orchestra.filter.OrchestraServletFilter.doFilter(OrchestraServletFilter.java:77)
      org.apache.myfaces.orchestra.lib.CompoundFilter$1.doFilter(CompoundFilter.java:58)
      org.apache.myfaces.orchestra.lib._NullFilter.doFilter(_NullFilter.java:45)
      org.apache.myfaces.orchestra.lib.CompoundFilter.doFilter(CompoundFilter.java:63)


      root cause

      javax.faces.el.PropertyNotFoundException: Bean: java.lang.String, property: name
      org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:500)
      org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:472)
      org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:436)
      org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:85)
      org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:535)
      org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
      org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:386)
      javax.faces.component.UIOutput.getValue(UIOutput.java:80)
      org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:223)
      org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:69)
      org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:57)
      javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
      org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
      org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
      org.richfaces.renderkit.OrderingListRendererBase.encodeOneRow(OrderingListRendererBase.java:188)
      org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:87)
      org.richfaces.model.OrderingListDataModel.walk(OrderingListDataModel.java:48)
      org.ajax4jsf.component.UIDataAdaptor.walk(UIDataAdaptor.java:994)
      org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:107)
      org.richfaces.renderkit.OrderingListRendererBase.encodeRows(OrderingListRendererBase.java:111)
      org.richfaces.renderkit.AbstractRowsRenderer.encodeChildren(AbstractRowsRenderer.java:139)
      javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:527)
      javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:483)
      javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:364)
      org.apache.jsp.page.workspace.task.orderlist_005ftest_jsp._jspx_meth_rich_005forderingList_005f0(orderlist_005ftest_jsp.java:208)
      org.apache.jsp.page.workspace.task.orderlist_005ftest_jsp._jspx_meth_h_005fform_005f0(orderlist_005ftest_jsp.java:162)
      org.apache.jsp.page.workspace.task.orderlist_005ftest_jsp._jspx_meth_f_005fview_005f0(orderlist_005ftest_jsp.java:130)
      org.apache.jsp.page.workspace.task.orderlist_005ftest_jsp._jspService(orderlist_005ftest_jsp.java:97)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
      org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
      org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
      org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
      org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
      org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
      org.apache.myfaces.orchestra.filter.OrchestraServletFilter.doFilter(OrchestraServletFilter.java:77)
      org.apache.myfaces.orchestra.lib.CompoundFilter$1.doFilter(CompoundFilter.java:58)
      org.apache.myfaces.orchestra.lib._NullFilter.doFilter(_NullFilter.java:45)
      org.apache.myfaces.orchestra.lib.CompoundFilter.doFilter(CompoundFilter.java:63)