PDA

View Full Version : CDE - How to use the "bookmarkable-parameters"



dgroen
07-11-2012, 09:10 AM
Hi,

I need to pass the state of my dropdownboxes on from one dashboard to another in order to keep selections. Do I achieve this with the "bookmarkable: option on the parameters? And if so; how do I use them?

Regards,

Dennis

hi5
07-11-2012, 09:59 AM
Bookmark state should work but I haven't tried that route. You can also use simple url parameters and a custom parameter in the receiving report. Details in this post:
http://forums.pentaho.com/showthread.php?94560-link-from-one-dashboard-to-another-by-clicking-a-table-component-row (http://forums.pentaho.com/showthread.php?94560-link-from-one-dashboard-to-another-by-clicking-a-table-component-row)


I like the idea of using bookmarks instead of the custom parameter javascript. Looks like URI encoded JSON.

dashboardFile.wcdf&bookmarkState=%7B"impl"%3A"client"%2C"params"%3A%7B"country"%3A"Canada"%7D%7D
=
dashboardFile.wcdf&bookmarkState={"impl":"client","params":{"country":"Canada"}}

hi5
07-11-2012, 10:29 AM
I tried the bookmark route. This works, it's a table click-action:

function(a){
var bookmark = encodeURI('{"impl":"client","params":{"pBook":"' + a.tableData[a.rowIdx][1] + '"}}');
window.location = './Render?solution=reference&path=dashboards&file=BookDetail.wcdf&bookmarkState=' + bookmark;
}

dgroen
07-12-2012, 04:33 AM
Thanks for the replies, it got me on the right track and got it working now.

My case was a custom menu with hard urls to other dashboards and didn't realize that the bookmarkState should be passed through the querystring. now I did something like:

this.location.href='/pentaho/content/pentaho-cdf-dd/Render?solution=AHG&path=&file=cde_cost_comparison.wcdf&bookmarkState=' + getParameter('bookmarkState');

where the getParameter ('bookmarkState') simply grabs the current state from the QueryString.