> -----Original Message-----
> From: Pavankumar Chayanam
> Sent: Thursday, April 28, 2005 12:04 AM
> 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.
That's because you shouldn't have to modify any files to get your desired
result. Or, at least, any files other than the JSP with the displaytag
table in it.
> 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().
No, what I was saying is that doing something like property="F1" causes
displaytag to try to access object.getF1() to get the value for that column.
Or that it may call that: normally you'd lower-case the initial letter of
the property name, i.e. f1 would cause it call getF1(). If you don't have a
getF1() method on the objects in your list, then this won't work.
The *real* issue, I'm guessing (and I'm guessing because you still haven't
specified what results you get other than it doesn't work), is something I
pointed out in my last e-mail:
<displaytag:table name="${results}" pagesize="10">
You're misusing the value of the name attribute. That EL expression, i.e.
${results}, is going to try to get the toString() value of the results
object. First, there probably is no results object in scope at that point.
Second, that's not what displaytag wants in that case. What it wants is the
key value used to store your list object in the specified scope (which,
since you don't specify a scope, is the request). That means you need to
change your table tag to look like this:
<displaytag:table name="results" pagesize="10">
Make that change and verify that objects in your list have a getF1() method
and see if that works. If it still doesn't work, please make sure you're
more specific about what results you get.
-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user