[Logo] Infoglue - Official Forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Child Pages/Sort Pages tags  XML
Forum Index » Component Development
Author Message
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.
jaric

Admin
[Avatar]

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
[WWW]
jaric

Admin
[Avatar]

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
[WWW]
jaric

Admin
[Avatar]

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
[WWW]
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!
jaric

Admin
[Avatar]

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
[WWW]
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.
jaric

Admin
[Avatar]

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
[WWW]
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.
jaric

Admin
[Avatar]

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
[WWW]
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.
jaric

Admin
[Avatar]

Joined: 02/11/2009 10:09:03
Messages: 107
Location: Uppsala
Offline

Great!

Peter Jaric
Division for IT and Procurement
Uppsala University
[WWW]
 
Forum Index » Component Development
Go to:   
Powered by JForum 2.1.8 © JForum Team