I’ve run into an apparent bug with the Data View control (in 8.5.3 UP1 and 9) that I’d like to document and see if anyone has a solution. When you pass a custom data collection to the view (whether it be an array or event a collection of view entries) rather than using a view as the data source, the expand/collapse link to toggle the visibility of the details section does not work.
When you click on the expand/collapse link, it generates a partial refresh POST request (as seen in Firebug), but nothing changes on the screen.
I looked at the source and I can see why — the links that trigger the partial refresh are not named properly.
The expand/collapse links end up looking like this (should have a row number at the end, rather than null):
<a id="view:_id1:dataView1:0__show:null"
And the corresponding XSP.attachPartial function is even more messed up because it has the incorrect link name as the first parameter and has the data view ID as the last parameter (but it should be the ID of the row to refresh):
XSP.attachPartial("view:_id1:dataView1:0__show:null", null, "view:_id1:dataView1", "onclick", function(){}, 0, "view:_id1:dataView1");
I spent some time working on dojo code to replace the IDs, but to no avail. I even wrote code to copy the link, fix the ID, remove the original link, then generate the proper XSP.attachPartial function call on the fixed link. That kind of improved it, but when the view refreshed the target row disappeared completely — there was nothing at all in the response of the POST request. My assumption is that, even though I fixed it on the front end, when it got to the back end, it re-generated the bad IDs.
The toggleDetailVisible() and setDetailVisible() methods of the Data View also do not work. (toggleDetailVisible() seems to be broken completely in R9, even in a normal Data View.)
I can work around the issue, but I don’t want to have to set the detailsOnClient property and pre-load all of the details sections. While that would make it easy to manage toggling visibility with my own links (since the details would already be on the page but hidden), I don’t think that’s ideal from a performance perspective.
Confirmation? Suggestions?
Let me know if you’ve seen this issue, so I can confirm it. If you know of a way to fix it — even better!
I’ve posted this issue (albeit with less detail) in the XPages forum a few days ago as well: http://www-10.lotus.com/ldd/xpagesforum.nsf/xpTopicThread.xsp?documentId=2679178BDB872A2B85257BA0006D8A50
