| Author |
Message |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 02/09/2010 14:37:35
|
arcotc
Expert
Joined: 11/11/2009 14:24:05
Messages: 72
Offline
|
I have been happily using the ChildPages tag and the JSTL c:forEach tag, now that I've tried to integrate the SortPages tag things are falling apart.
My code is as follows:
If I remove the sortPages tag this code works perfectly, I've also changed the id for the sortPages to sortedChildPages and it still doesn't work. The issue appears to be with the output of the childPages tag. I'm getting the following stacktrace:
I've tried stepping through the sortPages tag in debug and this is happening on the setInput method.
Any thoughts?
Thanks,
Mark.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 03/09/2010 10:07:48
|
jaric
Admin
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.jpg)
Joined: 02/11/2009 10:09:03
Messages: 107
Location: Uppsala
Offline
|
My immediate thought is that the input parameter isn't supposed to get a List. Maybe it should get the id of a list? That is, removed the ${}. Just a guess.
|
Peter Jaric
Division for IT and Procurement
Uppsala University
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 03/09/2010 10:10:22
|
jaric
Admin
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.jpg)
Joined: 02/11/2009 10:09:03
Messages: 107
Location: Uppsala
Offline
|
After checking the manual, I must admit I don't think my guess is correct... I see that you've basically followed their example exactly, and yet it fails? Strange.
|
Peter Jaric
Division for IT and Procurement
Uppsala University
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 03/09/2010 10:14:02
|
jaric
Admin
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.jpg)
Joined: 02/11/2009 10:09:03
Messages: 107
Location: Uppsala
Offline
|
What happens if you, instead of using a property as root for the child pages, instead use a site node? As in the example:
|
Peter Jaric
Division for IT and Procurement
Uppsala University
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 04/09/2010 08:59:53
|
arcotc
Expert
Joined: 11/11/2009 14:24:05
Messages: 72
Offline
|
There is no difference. It fails in exactly the same way, when trying to set the 'input' property in SortPagesTag - failing with the conversion to type List!
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 06/09/2010 09:32:26
|
jaric
Admin
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.jpg)
Joined: 02/11/2009 10:09:03
Messages: 107
Location: Uppsala
Offline
|
In the source (for my version, which I think is 2.9.8.2), the input parameter is handled like this:
Which finally boils down to:
To me it looks like that the input should be an expression, ${...something...}, (like you have) that should evaluate to a List. And that would mean that childPages is not a List... Which is bizarre, but who knows? If you use the code below (not tested), what does it say?
|
Peter Jaric
Division for IT and Procurement
Uppsala University
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 06/09/2010 09:47:47
|
arcotc
Expert
Joined: 11/11/2009 14:24:05
Messages: 72
Offline
|
Jaric,
I total agreed with your deductions and had come to the same conclusion, and the code in my version 2.9.7.3 is the same.
When I output the debug message I get:
As should be expected!
Mark.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 06/09/2010 09:59:15
|
jaric
Admin
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.jpg)
Joined: 02/11/2009 10:09:03
Messages: 107
Location: Uppsala
Offline
|
The stock IG Sitemap component at http://www.infoglue.org/Developers/Components/Component_detail_page/?contentId=539 uses sortPages. Does that one work for you (i.e. do you still have it in your repositories somewhere)? If it does, then you can try to find the difference between your component and that one, otherwise it looks like something broke at some point, I guess.
|
Peter Jaric
Division for IT and Procurement
Uppsala University
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 06/09/2010 10:26:55
|
arcotc
Expert
Joined: 11/11/2009 14:24:05
Messages: 72
Offline
|
Jaric,
This is really strange, the Site Map demo does work, when I trap the setInput method on the SortPagesTag the value being passed in is an expression to be evaluated, i.e.
When I debug my own code the input property is being set with the already evaluated expression, i.e.
Any thoughts?
Mark.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 06/09/2010 11:34:04
|
jaric
Admin
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.jpg)
Joined: 02/11/2009 10:09:03
Messages: 107
Location: Uppsala
Offline
|
Do you have anything in the beginning of your page that affects how expressions are treated? Some JSP directive or something?
|
Peter Jaric
Division for IT and Procurement
Uppsala University
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 06/09/2010 11:58:00
|
arcotc
Expert
Joined: 11/11/2009 14:24:05
Messages: 72
Offline
|
That sorted it! I'm not certain what I had before but I overwrote the taglib declarations and everything else at the top of the component and it now works.
Thanks, I knew it would be something simple, I just didn't know what.
Mark.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 06/09/2010 12:22:17
|
jaric
Admin
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.jpg)
Joined: 02/11/2009 10:09:03
Messages: 107
Location: Uppsala
Offline
|
Great!
|
Peter Jaric
Division for IT and Procurement
Uppsala University
|
|
|
 |
|
|