2 Replies Latest reply on Jun 22, 2009 6:54 AM by John Doe

    Problem with attributes

    John Doe Newbie

      Hello,

      I want to subclass the org.richfaces.component.html.HtmlColumn class and have been trying in vain for a long time now to resolve the following error:

      org.apache.jasper.JasperException: Unable to convert string "false" to class "javax.el.ValueExpression" for attribute "sortable": Property Editor not registered with the PropertyEditorManager


      I dunno what I am doing wrong. Would someone please be so kind and take a look at my code_
      ?

      package web.ui.tags;
      
      import javax.el.ValueExpression;
      import javax.faces.component.UIComponent;
      
      Tag class:
      
      public class MyColumnTag extends org.richfaces.taglib.ColumnTag
      {
      
       public MyColumnTag()
       {
       super();
       }
      
       @Override
       public String getComponentType()
       {
       return "MyColumn";
       }
      
       @Override
       public String getRendererType()
       {
       return null;
       }
      
       public void release()
       {
       super.release();
       }
      
       public void setSortable(ValueExpression sortable)
       {
       super.setSortable(sortable);
       }
      
       protected void setProperties(UIComponent component)
       {
       super.setProperties(component);
       }
      
      }


      Component class:

      package web.ui;
      
      import java.io.IOException;
      
      import javax.faces.component.UIComponent;
      import javax.faces.context.FacesContext;
      
      public class MyColumn extends org.richfaces.component.html.HtmlColumn
      {
      
       public void encodeBegin(FacesContext context) throws IOException
       {
       super.encodeBegin(context);
       }
      
       public void encodeEnd(FacesContext context, UIComponent comp) throws IOException
       {
       super.encodeEnd(context);
       }
      }


      tld:
      <?xml version="1.0" encoding="UTF-8"?>
      <taglib version="2.1" xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd">
       <tlib-version>1.0</tlib-version>
       <short-name>mycomponents</short-name>
       <uri>http://myuri</uri>
       <tag>
       <name>MyDataGrid</name>
       <tag-class>ui.tags.MyDataGridTag</tag-class>
       <body-content>JSP</body-content>
       </tag>
       <tag>
       <name>MyColumn</name>
       <tag-class>ui.tags.MyColumnTag</tag-class>
       <body-content>JSP</body-content>
       <attribute>
       <name>sortable</name>
       <rtexprvalue>true</rtexprvalue>
       </attribute>
       </tag>
      </taglib>


      Since I subclass the ColumnTag shouldn't it just be sufficient to adjust the tld file? What causes this error?

      Please lead me towards the right direction.