You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Brummeline Braaten <br...@gmail.com> on 2007/03/08 09:12:41 UTC

t:datatable and newspapercolumns

I'm trying to wrap a long column over multiple columns with the 
t:dataTable newspapercolumns attribute.The problem is that I get an
error that says: 
Unable to find setter method for attribute: newspaperColumns
javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)

The code works when I don't use the newspapercolumn attribute, 
but then the column doesn't get wrapped over multiple columns 
as I want it to.

My code is like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<html>
<f:view>
<head>
<meta http-equiv="content-type"
   content="text/html; charset=iso-8859-1">
<title>Nytt i helse</title>
<link rel="stylesheet" href="../css/frontend.css"
   type="text/css"media="screen">
</head>
<body>
<h:form id="main">
<f:verbatim>
<div id="category_list_heading">
   Vennligst velg kategori:
</div>
</f:verbatim>
<t:dataTable id="kategorier" var="rader" 
newspaperColumns="5"binding="#{tabnavigering.categoryTable}" rows="5">
<f:facet name="spacer">
<f:verbatim>   </f:verbatim>
</f:facet>
<h:column>
<t:commandLink style="category_list" 
styleClass="category">
<h:outputText value="#{rader.categoryName}" />
</t:commandLink>
</h:column>
</t:dataTable>
</h:form>
</body>
</f:view>
</html>

Hope you can give me a hint to how I can solve it. 
It's getting a bit annoying:)



Re: t:datatable and newspapercolumns

Posted by Brummeline Braaten <br...@gmail.com>.
Mike Kienenberger <mkienenb <at> gmail.com> writes:

> 
> You should only have the MyFaces Core or the JSF on your classpath.
> 
> However, the most likely issue is that you're using Tomahawk 1.1.3 or
> earlier.  I'm pretty sure that the change to add newspaper table
> happened in 1.1.4.  I don't remember exactly, but I think it was in
> May of last year.
> 

I'm using the tomahawk 1.1.5 nightlybuild, so newspapercolumns should be there.




Re: t:datatable and newspapercolumns

Posted by Mike Kienenberger <mk...@gmail.com>.
You should only have the MyFaces Core or the JSF on your classpath.

However, the most likely issue is that you're using Tomahawk 1.1.3 or
earlier.  I'm pretty sure that the change to add newspaper table
happened in 1.1.4.  I don't remember exactly, but I think it was in
May of last year.


On 3/8/07, Brummeline Braaten <br...@gmail.com> wrote:
> Brummeline Braaten <brummeline <at> gmail.com> writes:
>
> >
> > I'm trying to wrap a long column over multiple columns with the
> > t:dataTable newspapercolumns attribute.The problem is that I get an
> > error that says:
> > Unable to find setter method for attribute: newspaperColumns
> > javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
> >
> > The code works when I don't use the newspapercolumn attribute,
> > but then the column doesn't get wrapped over multiple columns
> > as I want it to.
> >
> > My code is like this:
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> > "http://www.w3.org/TR/html4/strict.dtd">
> > <% <at> taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> > <% <at> taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> > <% <at>  taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
> > <html>
> > <f:view>
> > <head>
> > <meta http-equiv="content-type"
> >    content="text/html; charset=iso-8859-1">
> > <title>Nytt i helse</title>
> > <link rel="stylesheet" href="../css/frontend.css"
> >    type="text/css"media="screen">
> > </head>
> > <body>
> > <h:form id="main">
> > <f:verbatim>
> > <div id="category_list_heading">
> >    Vennligst velg kategori:
> > </div>
> > </f:verbatim>
> > <t:dataTable id="kategorier" var="rader"
> > newspaperColumns="5"binding="#{tabnavigering.categoryTable}" rows="5">
> > <f:facet name="spacer">
> > <f:verbatim>   </f:verbatim>
> > </f:facet>
> > <h:column>
> > <t:commandLink style="category_list"
> > styleClass="category">
> > <h:outputText value="#{rader.categoryName}" />
> > </t:commandLink>
> > </h:column>
> > </t:dataTable>
> > </h:form>
> > </body>
> > </f:view>
> > </html>
> >
> > Hope you can give me a hint to how I can solve it.
> > It's getting a bit annoying:)
> >
> >
>
> I've found out that perhaps I needed to update my web.xml file. The file looks
> like this now:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
> 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
>
> <web-app>
>   <display-name>Nye metoder Application</display-name>
>   <description>application.</description>
>   <context-param>
>     <param-name>contextConfigLocation</param-name>
>     <param-value>WEB-INF/applicationContext.xml
>                                 /WEB-INF/applicationContext-ejb.xml</param-value>
>         </context-param>
>         <filter>
>         <filter-name>MyFacesExtensionsFilter</filter-name>
>         <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter
> </filter-class>
>     <init-param>
>         <param-name>maxFileSize</param-name>
>         <param-value>100k</param-value>
>         <description>Set the size limit for uploaded files.
>             Format: 10 - 10 bytes
>                     10k - 10 KB
>                     10m - 10 MB
>                     1g - 1 GB
>         </description>
>     </init-param>
> </filter>
>
> <filter-mapping>
>     <filter-name>MyFacesExtensionsFilter</filter-name>
>     <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
> </filter-mapping>
>
> <filter-mapping>
>     <filter-name>MyFacesExtensionsFilter</filter-name>
>     <!-- servlet-name must match the name of your
> javax.faces.webapp.FacesServlet entry -->
>     <servlet-name>*.jsf</servlet-name>
> </filter-mapping>
> <filter-mapping>
>     <filter-name>MyFacesExtensionsFilter</filter-name>
>     <!-- servlet-name must match the name of your
> javax.faces.webapp.FacesServlet entry -->
>     <servlet-name>/faces/*</servlet-name>
> </filter-mapping>
>
>   <servlet>
>   <servlet-name>Faces Servlet</servlet-name>
>     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>     <init-param>
>       <param-name>config</param-name>
>       <param-value>/WEB-INF/faces-config.xml</param-value>
>     </init-param>
>     <init-param>
>       <param-name>debug</param-name>
>       <param-value>3</param-value>
>     </init-param>
>     <init-param>
>       <param-name>detail</param-name>
>       <param-value>3</param-value>
>     </init-param>
>     <load-on-startup>0</load-on-startup>
>   </servlet>
>
>
>   <servlet-mapping>
>     <servlet-name>Faces Servlet</servlet-name>
>     <url-pattern>*.faces</url-pattern>
>   </servlet-mapping>
>   <welcome-file-list>
>     <welcome-file>webmetoder/index.jsp</welcome-file>
>   </welcome-file-list>
>
> </web-app>
>
>
> I still get the same error message:
> javax.servlet.ServletException: org.apache.jasper.JasperException:
> /innhold/kategoriliste.jsp(22,4) Unable to find setter method for attribute:
>  newspaperColumns
>         javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
>
> The setter method is in the HtmlDataTable.class of the tomahawk library.
> I get an error when I start the server also:
> Both RI and myfaces jsf are on your classpath.
> Could this have anything to do with the setter method error?
> What do I have to do to find the method?
>
>
>

Re: t:datatable and newspapercolumns

Posted by Brummeline Braaten <br...@gmail.com>.
Brummeline Braaten <brummeline <at> gmail.com> writes:

> 
> I'm trying to wrap a long column over multiple columns with the 
> t:dataTable newspapercolumns attribute.The problem is that I get an
> error that says: 
> Unable to find setter method for attribute: newspaperColumns
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
> 
> The code works when I don't use the newspapercolumn attribute, 
> but then the column doesn't get wrapped over multiple columns 
> as I want it to.
> 
> My code is like this:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <% <at> taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <% <at> taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <% <at>  taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
> <html>
> <f:view>
> <head>
> <meta http-equiv="content-type"
>    content="text/html; charset=iso-8859-1">
> <title>Nytt i helse</title>
> <link rel="stylesheet" href="../css/frontend.css"
>    type="text/css"media="screen">
> </head>
> <body>
> <h:form id="main">
> <f:verbatim>
> <div id="category_list_heading">
>    Vennligst velg kategori:
> </div>
> </f:verbatim>
> <t:dataTable id="kategorier" var="rader" 
> newspaperColumns="5"binding="#{tabnavigering.categoryTable}" rows="5">
> <f:facet name="spacer">
> <f:verbatim>   </f:verbatim>
> </f:facet>
> <h:column>
> <t:commandLink style="category_list" 
> styleClass="category">
> <h:outputText value="#{rader.categoryName}" />
> </t:commandLink>
> </h:column>
> </t:dataTable>
> </h:form>
> </body>
> </f:view>
> </html>
> 
> Hope you can give me a hint to how I can solve it. 
> It's getting a bit annoying:)
> 
> 

I've found out that perhaps I needed to update my web.xml file. The file looks
like this now:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
  <display-name>Nye metoder Application</display-name>
  <description>application.</description>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>WEB-INF/applicationContext.xml
				/WEB-INF/applicationContext-ejb.xml</param-value>
	</context-param>
	<filter>
	<filter-name>MyFacesExtensionsFilter</filter-name>
	<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter
</filter-class>
    <init-param>
        <param-name>maxFileSize</param-name>
        <param-value>100k</param-value>
        <description>Set the size limit for uploaded files.
            Format: 10 - 10 bytes
                    10k - 10 KB
                    10m - 10 MB
                    1g - 1 GB
        </description>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>

<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <!-- servlet-name must match the name of your
javax.faces.webapp.FacesServlet entry -->
    <servlet-name>*.jsf</servlet-name>
</filter-mapping>
<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <!-- servlet-name must match the name of your
javax.faces.webapp.FacesServlet entry -->
    <servlet-name>/faces/*</servlet-name>
</filter-mapping>
	  
  <servlet>
  <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/faces-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>3</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>3</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
  </servlet>


  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>webmetoder/index.jsp</welcome-file>
  </welcome-file-list>

</web-app>


I still get the same error message: 
javax.servlet.ServletException: org.apache.jasper.JasperException: 
/innhold/kategoriliste.jsp(22,4) Unable to find setter method for attribute:
 newspaperColumns
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)

The setter method is in the HtmlDataTable.class of the tomahawk library. 
I get an error when I start the server also: 
Both RI and myfaces jsf are on your classpath. 
Could this have anything to do with the setter method error?
What do I have to do to find the method?



Re: t:datatable and newspapercolumns SOLVED!

Posted by Brummeline Braaten <br...@gmail.com>.
To change from binding to value helped! I also had to change from datatable to 
newspapertable. A bit strange since I have the newest nightly build of tomahawk,
 but at least it's working!!!!!!

Thank you for your help! Have a nice weekend!

I'll guess I need more help later:)


Re: t:datatable and newspapercolumns

Posted by Brummeline Braaten <br...@gmail.com>.
Yaron Spektor <yaron.spektor <at> b6systems.com> writes:

> 
> Have you tried it with value instead of binding?
> 
> This is a code I use:
> <t:dataTable newspaperOrientation="horizontal" value="#{bean.valueList}"
> newspaperColumns="10" rowIndexVar="col"  var="index"
> columnClasses="#{bean.styleClassString}" >....
> 
> Yaron 
> 
> I'm trying to wrap a long column over multiple columns with the 
> t:dataTable newspapercolumns attribute.The problem is that I get an
> error that says: 
> Unable to find setter method for attribute: newspaperColumns
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
> 
> The code works when I don't use the newspapercolumn attribute, 
> but then the column doesn't get wrapped over multiple columns 
> as I want it to.
> 
> My code is like this:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <% <at> taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <% <at> taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <% <at>  taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
> <html>
> <f:view>
> <head>
> <meta http-equiv="content-type"
>    content="text/html; charset=iso-8859-1">
> <title>Nytt i helse</title>
> <link rel="stylesheet" href="../css/frontend.css"
>    type="text/css"media="screen">
> </head>
> <body>
> <h:form id="main">
> <f:verbatim>
> <div id="category_list_heading">
>    Vennligst velg kategori:
> </div>
> </f:verbatim>
> <t:dataTable id="kategorier" var="rader" 
> newspaperColumns="5"binding="#{tabnavigering.categoryTable}" rows="5">
> <f:facet name="spacer">
> <f:verbatim>   </f:verbatim>
> </f:facet>
> <h:column>
> <t:commandLink style="category_list" 
> styleClass="category">
> <h:outputText value="#{rader.categoryName}" />
> </t:commandLink>
> </h:column>
> </t:dataTable>
> </h:form>
> </body>
> </f:view>
> </html>
> 
> Hope you can give me a hint to how I can solve it. 
> It's getting a bit annoying:)
> 
> 
I've tried with value instead, and I now get this error:

javax.servlet.ServletException: Bean: javax.faces.component.UIData, 
property: categoryName javax.faces.webapp.FacesServlet.
service(FacesServlet.java:152)

And when I look at the console in MyEclipse I see this:
ERROR [RendererUtils] Property not found - called by component : 
{Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: 
/innhold/kategoriliste.jsp][Class: javax.faces.component.html.HtmlForm,Id:
 main][Class: org.apache.myfaces.custom.newspaper.HtmlNewspaperTable,Id: 
_idJsp1][Class: javax.faces.component.UIColumn,Id: _idJsp3][Class: 
org.apache.myfaces.component.html.ext.HtmlCommandLink,Id: _idJsp4][Class: 
javax.faces.component.html.HtmlOutputText,Id: _idJsp5]}
javax.faces.el.PropertyNotFoundException: Bean: javax.faces.component.UIData, 
property: categoryName

This is so strange, because it finds the categoryName when I just use a normal
dataTable.




RE: t:datatable and newspapercolumns

Posted by Yaron Spektor <ya...@b6systems.com>.
Have you tried it with value instead of binding?

This is a code I use:
<t:dataTable newspaperOrientation="horizontal" value="#{bean.valueList}"
newspaperColumns="10" rowIndexVar="col"  var="index"
columnClasses="#{bean.styleClassString}" >....

Yaron 

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Brummeline Braaten
Sent: Thursday, March 08, 2007 3:13 AM
To: users@myfaces.apache.org
Subject: t:datatable and newspapercolumns

I'm trying to wrap a long column over multiple columns with the 
t:dataTable newspapercolumns attribute.The problem is that I get an
error that says: 
Unable to find setter method for attribute: newspaperColumns
javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)

The code works when I don't use the newspapercolumn attribute, 
but then the column doesn't get wrapped over multiple columns 
as I want it to.

My code is like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<html>
<f:view>
<head>
<meta http-equiv="content-type"
   content="text/html; charset=iso-8859-1">
<title>Nytt i helse</title>
<link rel="stylesheet" href="../css/frontend.css"
   type="text/css"media="screen">
</head>
<body>
<h:form id="main">
<f:verbatim>
<div id="category_list_heading">
   Vennligst velg kategori:
</div>
</f:verbatim>
<t:dataTable id="kategorier" var="rader" 
newspaperColumns="5"binding="#{tabnavigering.categoryTable}" rows="5">
<f:facet name="spacer">
<f:verbatim>   </f:verbatim>
</f:facet>
<h:column>
<t:commandLink style="category_list" 
styleClass="category">
<h:outputText value="#{rader.categoryName}" />
</t:commandLink>
</h:column>
</t:dataTable>
</h:form>
</body>
</f:view>
</html>

Hope you can give me a hint to how I can solve it. 
It's getting a bit annoying:)