Hi,
I am having the same problem as Monika. When I sort on the field decorated with the
TableDecorator, I get NullPointerException for the row object. I tried using v1.0-b3
but was getting the following stack trace:
2004-02-06 12:14:59,897 [WARN,LookupUtil] --- Exception: [.LookupUtil] Error loo
king up property "name" in object type "com.db.grt.dbscore.server.struts.decorat
or.IndicatorFieldSetDecorator"
Cause: null
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor623.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(Property
Utils.java:1185)
at org.displaytag.util.LookupUtil.getBeanProperty(LookupUtil.java:196)
at org.displaytag.model.RowSorter.compare(RowSorter.java:109)
at java.util.Arrays.mergeSort(Arrays.java:1237)
at java.util.Arrays.mergeSort(Arrays.java:1244)
at java.util.Arrays.sort(Arrays.java:1185)
at java.util.Collections.sort(Collections.java:151)
at org.displaytag.model.TableModel.sortRowList(TableModel.java:302)
at org.displaytag.model.TableModel.sortPageList(TableModel.java:325)
at org.displaytag.tags.TableTag.doEndTag(TableTag.java:830)
at jsp_servlet._jsp._admin._indicator.__pnlindicatorfieldset._jspService
(__pnlindicatorfieldset.java:639)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispat
cherImpl.java:594)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispat
cherImpl.java:409)
at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:155
)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:13
7)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756
)
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(Inser
tTag.java:881)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
at jsp_servlet._jsp._tiles._layouts.__dbscorebaselayout._jspService(__db
scorebaselayout.java:396)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.RequestDispatcherImpl$ForwardAction.run(Req
uestDispatcherImpl.java:382)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
cherImpl.java:286)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.
java:1069)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestP
rocessor.java:274)
at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(
TilesRequestProcessor.java:254)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Ti
lesRequestProcessor.java:309)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
2)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Caused by: java.lang.NullPointerException
at com.db.grt.dbscore.server.struts.decorator.IndicatorFieldSetDecorator
.getName(Unknown Source)
... 54 more
Since Monika was able to get the problem sorted with version b2, I tried with that
with no luck. It still gives the same problem.
Has anybody got over the problem using the TableDecorator itself? Or is it not
possible only?
Would appreciate response.
Thanks and best regds,
Rishabh.
[EMAIL PROTECTED]
Sent by: To: [EMAIL
PROTECTED]
[EMAIL PROTECTED] cc:
ceforge.net Subject: RE:
[displaytag-user] problem with sorting column which is generated using
TableDecorator
20/01/2004 03:31
Please respond to
displaytag-user
If you're using 1.0 b2, give the table and "id" attribute, and then give
your column a body and write the link yourself:
<display:table id="foo">
<display:column>
<a href="mylink?id=<c:out value="${foo.id}"/>...
</display:column>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Monika Adamczyk
> Sent: Monday, January 19, 2004 11:12 AM
> To: [EMAIL PROTECTED]
> Subject: [displaytag-user] problem with sorting column which
> is generated using TableDecorator
>
>
> I have a table decorator that generates a column as an href
> link using more than 1 attribute of the current row object.
>
> The code is something like this:
>
> public class MyHrefDecorator extends TableDecorator
> {
> public String getHref()
> {
> Object o = getCurrentRowObject();
>
> // creates string <a
> href="http://SOMEURL?attribute1=1&attribute2=2">
> //Name</a>
> String hrefStr = ... o.getAttribute1 ... + o.getAttribute2
>
> return hrefStr
> }
>
> }
>
>
> On the jps page, the column tag is set as follows: <table:column
> title="Header1"
> property="href"
> sortable="true"
> width="400"
> maxLength="400"/>
>
> On initial loading of the page, the table loads and generates
> everything correctly. However if I click on the Header1 to
> sort table by this column, there is NullPointerException in
> my decorator class: Object o = getCurrentRowObject(); - this
> object is null. If I try to sort by other columns (which
> don't use decorators), I don't have a problem with sorting.
>
> I can't use column decorator since I need to build link from
> more than one row object attribute. Can someone suggest how I
> can solve this problem?
>
> Thanks
> Monika
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbo> nus
>
>
>
>
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim,
> CA. http://www.eclipsecon.org/osdn
> _______________________________________________
> displaytag-user mailing list [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
--
This e-mail may contain confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorized copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user