hi
well if i add in list vector
an object of class Fruits where class fruits contains
public class Fruits {
private String NAME_of_FRUIT;
private String COLOR;
}
i write in my display:column tag
<display:column property="NAME_of_FRUIT"
title="FruitName"
sortable="true" headerClass="sortable" />
<display:column property="COLOR" title="color"
sortable="true" headerClass="sortable" />
2> also i have written
<%@ import com.database.Fruits;%>
may be this wud help
get back if u dont get reply
thanks
--- nurjahan Begum <[EMAIL PROTECTED]> wrote:
> Thanks Vilpesh.
>
> Now I get the following error:
>
> org.apache.jasper.JasperException: LookupException
> while trying to fetch property "getFaultID". Cause:
> Error looking up property "getFaultID" in object
> type
> "database.FaultDetails"..
> at
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:207)
>
> Any idea why thats happening?
> Here's the code:
>
> <[EMAIL PROTECTED] import="javax.servlet.http.*"%>
> <[EMAIL PROTECTED] import="java.net.*"%>
> <[EMAIL PROTECTED] import="java.util.*,
> org.displaytag.tags.TableTag, org.displaytag.*"%>
> <[EMAIL PROTECTED] import="database.*"%>
> <%@ page session="true" %>
> <%@ taglib uri="/WEB-INF/displaytag-12.tld"
> prefix="display" %>
>
>
> <%
> DatabaseTransactions dtrans = new
> DatabaseTransactions();
> ArrayList vector = null;
> try{
> vector = new ArrayList();
> vector = dtrans.getAllOutStandingFaults();
> System.out.println(vector.size());
> } catch(Exception ex) {
> ex.printStackTrace();
> }
>
> Object foo = session.getAttribute( "vector" );
> if( foo == null ) {
> session.setAttribute("vector", vector);
> }
> %>
>
>
>
>
> <display:table name="sessionScope.vector"
> defaultsort="1" defaultorder="descending">
> <display:column property="getFaultID" title="ID"
> sortable="true" headerClass="sortable" />
> <display:column property="getDateLogged"
> sortable="true" headerClass="sortable"/>
> <display:column property="getRoom" sortable="true"
> headerClass="sortable" />
> <display:column property="getFault"/>
> </display:table>
>
>
>
>
> --- Vilpesh Mistry <[EMAIL PROTECTED]> wrote:
> > hi
> > well u are making the vector named arraylist on
> this
> > jsp page and populating it with objects of class
> > fault.
> > This is done on this jsp page and u are not adding
> > this vector in session.
> > U are trying to find vector in session scope,
> which
> > u
> > will never get.
> > solution 1>
> > Populate the vector in the session before calling
> > this
> > page.
> > solution 2>
> > i donot know properly what u have to write for
> > removing SessionScope..
> > remove sessionScope from here and replace with may
> > be
> > pageScope or just write
> > <display:table name="vector"
> > instead of
> > <display:table name="sessionScope.vector"
> >
> > thanks
> > --- nurjahan Begum <[EMAIL PROTECTED]>
> wrote:
> >
> > > Can someone please help me. I attemped to use
> > > sorting
> > > for table, but i am having please help.
> > >
> > > What I have done so far is do a SQL query, I
> have
> > > put
> > > the ResultSet as objects in ArrayList.
> > >
> > > It has a Fault Object, with attributes:
> > >
> > > ID Date_Logged Location etc etc.
> > >
> > > My problem is I don't know implement DisplayTag
> in
> > > my
> > > jsp. I m totally new to tags in genral, so the
> > > example
> > > did not make any sense. I copied over all the
> > > relevant
> > > jars and tld files in the right directory.
> > >
> > >
> > > Here's what I got, which I know is wrong please
> > send
> > > me sample code.
> > >
> > >
> > > <[EMAIL PROTECTED] import="javax.servlet.http.*"%>
> > > <[EMAIL PROTECTED] import="java.net.*"%>
> > > <[EMAIL PROTECTED] import="java.util.*,
> > > org.displaytag.tags.TableTag,
> org.displaytag.*"%>
> > > <[EMAIL PROTECTED] import="database.*"%>
> > > <%@ page session="true" %>
> > > <%@ taglib uri="/WEB-INF/displaytag-11.tld"
> > > prefix="display" %>
> > >
> > >
> > > <%
> > > DatabaseTransactions dtrans = new
> > > DatabaseTransactions();
> > > try{
> > > ArrayList vector = new ArrayList();
> > > vector = dtrans.getAllOutStandingFaults();
> > > System.out.println(vector.size());
> > > } catch(Exception ex) {
> > > ex.printStackTrace();
> > > }
> > > %>
> > >
> > >
> > > <% Object foo = session.getAttribute( "vector"
> );
> > > if( foo == null ) {
> > > session.setAttribute( "vector", new
> > TestList(
> > > 10, false ) );
> > > }
> > > %>
> > >
> > >
> > > <h2><a href="./index.jsp">Examples</a> >
> > > Auto-sorting
> > > by columns</h2>
> > >
> > > <display:table name="sessionScope.vector"
> > > defaultsort="1" defaultorder="descending">
> > > <display:column property="id" title="ID"
> > > sortable="true" headerClass="sortable" />
> > > <display:column property="Date_Logged"
> > > sortable="true" headerClass="sortable"/>
> > > <display:column property="Location"
> > > sortable="true"
> > > headerClass="sortable" />
> > > <display:column property="Problem"/>
> > > </display:table>
> > >
> > >
> > >
> > >
> > >
> > >
> >
>
___________________________________________________________
> > >
> > > ALL-NEW Yahoo! Messenger - all new features -
> even
> > > more fun! http://uk.messenger.yahoo.com
> > >
> > >
> > >
> >
>
-------------------------------------------------------
> > > SF email is sponsored by - The IT Product Guide
> > > Read honest & candid reviews on hundreds of IT
> > > Products from real users.
> > > Discover which products truly live up to the
> hype.
> > > Start reading now.
> > >
> >
>
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > > _______________________________________________
> > > displaytag-user mailing list
> > > [email protected]
> > >
> >
>
https://lists.sourceforge.net/lists/listinfo/displaytag-user
> > >
> >
>
=== message truncated ===
__________________________________
Do you Yahoo!?
All your favorites on one personal page � Try My Yahoo!
http://my.yahoo.com
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user