|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
partial listsI just started using displaytag and this mailing list. I'm getting a massive headache trying to get External paging/sorting working. It seems to make sense in the documentation, but I'm getting the following error from my jsp page: Caused by: javax.servlet.jsp.JspTagException: You must specify one of the following: size at org.displaytag.tags.TableTag.initParameters(TableTag.java:966) at org.displaytag.tags.TableTag.doStartTag(TableTag.java:722) at org.apache.jsp.WEB_002dINF.jsp.txsearch_jsp._jspService(txsearch_jsp.java:620) I am specifying that parameter, but it doesn't seem to recognize it. (This was working fine before I tried to use external paging with partial lists) Here is my table tag on the offending line of jsp code: <display:table name="results.list" id="txResults" sort="external" defaultsort="1" export="true" pagesize="5" requestURI="" partialList="true" size="7"> I've tried many different things including different expressions for size, and as in this example, just hard coding the correct value also changing the order of the attributes. I've also looked at the source code and the mailing list archives without solving the problem. This dead thread seems to show the same unresolved issue: http://www.mail-archive.com/displaytag-user@.../msg05950.html The author of that thread gave up :-( to implement it themselves. The line of code in the displaytag source where it is failing is org.displaytag.tags.TableTag.initParameters(TableTag.java:966) I've copied that line and the surrounding code below but I can't figure out anything from it. Please help me or I fear I will suffer the same fate as the previous poster and have to abandon use of displaytag entirely. - Peter ------------------------------------ // if we are doing partialLists then ensure we have our *) object if (this.partialList) { if ((this.sizeObjectName == null) && (this.size == null)) { // ? } if (this.sizeObjectName != null) { // retrieve the object from scope this.size = evaluateExpression(this.sizeObjectName); } if (size == null) { throw new JspTagException(Messages.getString("MissingAttributeException.msg", new Object[]{"size"})); // THIS IS WHERE THE EXCEPTION COMES FROM!!! } else if (!(size instanceof Integer)) { throw new JspTagException(Messages.getString( "InvalidTypeException.msg", new Object[]{"size", "Integer"})); } } ------------------------------------ Discover a magical Christmas destination. Visit asksanta.ca today! ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 _______________________________________________ displaytag-user mailing list displaytag-user@... https://lists.sourceforge.net/lists/listinfo/displaytag-user |
|
|
Re: partial listsTake a look at the documentation: http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html
I believe that when implementing in this fashion that the size
parameter must be set to the name of variable that is a java.lang.Integer
that is in a scope accessible by Displaytag.
From: displaytag-user-bounces@... [mailto:displaytag-user-bounces@...] On Behalf Of Peter Rumstle Sent: Tuesday, December 04, 2007 9:54 PM To: displaytag-user@... Subject: [displaytag-user] partial lists I just started using displaytag and this mailing list. I'm getting a massive headache trying to get External paging/sorting working. It seems to make sense in the documentation, but I'm getting the following error from my jsp page: Caused by: javax.servlet.jsp.JspTagException: You must specify one of the following: size at org.displaytag.tags.TableTag.initParameters(TableTag.java:966) at org.displaytag.tags.TableTag.doStartTag(TableTag.java:722) at org.apache.jsp.WEB_002dINF.jsp.txsearch_jsp._jspService(txsearch_jsp.java:620) I am specifying that parameter, but it doesn't seem to recognize it. (This was working fine before I tried to use external paging with partial lists) Here is my table tag on the offending line of jsp code: <display:table name="results.list" id="txResults" sort="external" defaultsort="1" export="true" pagesize="5" requestURI="" partialList="true" size="7"> I've tried many different things including different expressions for size, and as in this example, just hard coding the correct value also changing the order of the attributes. I've also looked at the source code and the mailing list archives without solving the problem. This dead thread seems to show the same unresolved issue: http://www.mail-archive.com/displaytag-user@.../msg05950.html The author of that thread gave up :-( to implement it themselves. The line of code in the displaytag source where it is failing is org.displaytag.tags.TableTag.initParameters(TableTag.java:966) I've copied that line and the surrounding code below but I can't figure out anything from it. Please help me or I fear I will suffer the same fate as the previous poster and have to abandon use of displaytag entirely. - Peter ------------------------------------ // if we are doing partialLists then ensure we have our *) object if (this.partialList) { if ((this.sizeObjectName == null) && (this.size == null)) { // ? } if (this.sizeObjectName != null) { // retrieve the object from scope this.size = evaluateExpression(this.sizeObjectName); } if (size == null) { throw new JspTagException(Messages.getString("MissingAttributeException.msg", new Object[]{"size"})); // THIS IS WHERE THE EXCEPTION COMES FROM!!! } else if (!(size instanceof Integer)) { throw new JspTagException(Messages.getString( "InvalidTypeException.msg", new Object[]{"size", "Integer"})); } } ------------------------------------ Discover a magical Christmas destination. Visit asksanta.ca today! ***Note:The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the Sender immediately by replying to the message and deleting it from your computer. Thank you. Premier Inc. ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 _______________________________________________ displaytag-user mailing list displaytag-user@... https://lists.sourceforge.net/lists/listinfo/displaytag-user |
|
|
Re: partial lists<% Integer listCount = new Integer(7); %> <display:table name="results.list" id="txResults" sort="external" defaultsort="1" export="true" pagesize="5" requestURI="" partialList="true" size="listCount"> ... (I also tried with size="${listCount}") This still generated the same exception. Does anyone have a working example of partialLists implemented anywhere? I can't find a war file example, the displaytag example are lacking this recent feature. Paul
Discover a magical Christmas destination. Visit asksanta.ca today! ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 _______________________________________________ displaytag-user mailing list displaytag-user@... https://lists.sourceforge.net/lists/listinfo/displaytag-user |
|
|
Re: partial listsHey Peter,
Here is what i do :- <% int pageSize=25; %> <display:table name="name" id="myId" export="true" class="className" pagesize="<%=pageSize%>" partialList="true" size="totalSize"> Let me know if this works Thanks Sh
|
|
|
Re: partial listsHi,
I had the same problem today. After 1 hour wasted, I discovered that the object that display:table is passed as "the number of items in the current page" must be of type Integer. In my case, the exception appeared because the type of the object was string. Here is my work-around: // Struts form property accessed from JSP // This doesn't work, returns String instead of Integer public String getNumItems() { return numItems; } // Struts form property accessed from JSP // This wrapper will work just fine public Integer getNumItemsAsInteger() { if (StringUtils.isBlank(getNumItems())) return new Integer(0); return Integer.parseInt(getNumItems()); } Good luck to you all :-) |
| Free Forum Powered by Nabble | Forum Help |