Hi Rick,

           thanks for your response regarding displaytag. 
Rick I am using the displaytag for the first time and more over the
documentation for displaytag is not clear. There is no mention in the
document regarding the flow of different classes in displaytag
package.  (Please see below for my problem).

I know very well that bean will have getter/setter methods which we
will normally use to display the data in jsp. but in the documentation
its not clearly mentioned that which files needs to be modified to get
our desired result.

you have suggested getF1() instead of F1 in the property attribute  of
column tag
<displaytag:table name="${results}" pagesize="10">
<displaytag:column property="F1" >  // F1 is the table column name 
and moreover my al (arraylist/list) object is holding 10 rows of data
for the column F1.

In the samples they are passing property names as city,project instead
of getCity() , getProject().

Please suggest different files that needs to be customized to display
the data in the table.

please see below regarding the problem.

thanks in advance,
Pavan.
> >>    I have problem in displaying data in displaytag table. I am
> >> fetching data
> >> from database into an arraylist/list object.
> >>
> >> al = getData() // fetches data from database and arraylist object al
> >> holds the
> >>                   data.  al can be arraylist object or list object
> >>
> >> request.setAttribute("results",al);
> >>
> >> <display:table name="${results} pagesize="10">
> >> <display:column property="F1" value=" ">  // F1 is table column name
> >> in database
> I'm not sure how displaytag will treat that F1 thing.  Normally
> displaytag converts your property from "property" to "getProperty()",
> i.e. it capitalizes the first letter of the property name.  Will
> starting the property name with a capital cause an issue?  It might.
> 
> So first suggestion is to try property="f1".
> 
> Second, what kinds of objects are going into your list object?  Without
> knowing what objects are in the list returned by your getData() method
> and without knowing what kind of undesired result you get (you still
> haven't said precisely what's going wrong, just that you're having a
> problem), it's very difficult to tell what's going on in that part.  The
> first thing I'd guess is that you're returning a list of lists or
> hashtables, which require special treatment.  Really, displaytag is most
> comfortable (in my experience) handling bean objects, i.e. instead of
> needing to do get("key"), you've got property getters and setters.
> 
> Finally, one thing that's DEFINITELY wrong is this:
> 
> <display:table name="$(results) pagesize="10">
> 
> The double quotes around the name aren't closed, so that would cause an
> error.  Fix that, but there's another, even bigger problem here.  You
> don't need an EL expression for the name attribute and you're not
> specifying a valid EL expression for the name attribute anyways.
> 
> First, for valid EL expressions, you have to use '{' and '}' braces.  So
> that would be ${results} instead of $(results).  Second, an EL
> expression *evaluates* out to its String value, which is not what you
> want in that case.  Since you're never setting a value for "results",
> that would definitely give you unexpected results; setting an object as
> a request attribute with a particular key does not create an object of
> that name with a particular value. Instead, you want to pass the name
> used to store the object in the request attribute store.  In this case,
> that is literally "results":
> 
> <display:table name="results" pagesize="10">
> 
> You've got a lot of problems going on with this in terms of valid
> syntax, using expressions in the proper place, and so on.  I'd really
> suggest using NetBeans or Eclipse or (optimally, but it costs money)
> IntelliJ IDEA to help you more easily spot problems in your syntax.  Any
> one of those environments would have alerted you to the problem with not
> closing the quotes (at least, with the appropriate add-ons; I think you
> need a plug-in in Eclipse to properly parse JSP files).
> 
> --
> Rick Herrick
> [EMAIL PROTECTED]
> 
> I haven't got time for inner peace.
> 
> Get out of control, but appear under control. It's not bad to alarm other 
> people, though--it's good for them.--Hunter S. Thompson
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Tell us your software development plans!
> Take this survey and enter to win a one-year sub to SourceForge.net
> Plus IDC's 2005 look-ahead and a copy of this survey
> Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
> _______________________________________________
> displaytag-user mailing list
> displaytag-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>


-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id5hix
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to