PassFilterToBirstFromEmbedded JavaScript
<html>
<body>
<table>
<tr>
<td>Year</td>
<td><input type="text" id="yearValue"></td>
<td><button id="btnSampleFilter" onclick="filter()">Set prompt Year</button></td>
</tr>
<tr>
<td>Drill To</td>
<td>Dashboard:<input type="text" id="dName"></td>
<td>Page:<input type="text" id="pName">
<button id="btnDrillFilter" onclick="goToDashboard()">Drill To</button></td>
</tr>
</table>
<script>
function goToDashboard() {
var msgPkt = {
operation : 'drillToDashboard',
dashboard : document.getElementById( "dName" ).value,
page : document.getElementById( "pName" ).value
};
window.parent.postMessage( msgPkt, "*" );
}
function filter( ) {
var filters = [];
var inputVal = document.getElementById( "yearValue" ).value;
var subPrompt = {};
subPrompt.key = 'Time.Year';
subPrompt.operator = '>';
subPrompt.value = inputVal ? [inputVal] : ['2000'];
filters.push( subPrompt );
window.parent.postMessage( {operation : "setFilters", filters : filters}, "*" );
}
</script>
</body>
</html>