<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Passing params to another view" description="" screenshot="" author="" author_email="gorillaapi@claude.nl" author_location="" author_affiliation="" height="200">
<Require feature="opensocial-0.7" />
<Require feature="views" />
</ModulePrefs>
  <Content type="html">
  <![CDATA[
<script type="text/javascript">
function navigate(navigateview){
	var params = {};
	var currentview = gadgets.views.getCurrentView().getName();
	var availableviews = gadgets.views.getSupportedViews();
	for(i in availableviews) {
		// show all possible views with firebug
		//console.log(availableviews[i]);
	}
	if(currentview != navigateview && navigateview != '') {
		params['data1'] = 'This is paramdata';
		params['data2'] = 'This is paramdata to';
		gadgets.views.requestNavigateTo(availableviews[navigateview], params);
	} else {
		alert('You are allready on this view');
	}
}
function init() {
	var params = gadgets.views.getParams();
	if (typeof(params['data1']) == 'undefined') document.getElementById('sParam1').value = 'empty'; else document.getElementById('sParam1').value = params['data1'];
	if (typeof(params['data2']) == 'undefined') document.getElementById('sParam2').value = 'empty'; else document.getElementById('sParam2').value = params['data2'];	
}

gadgets.util.registerOnLoadHandler(init);
</script>
Which view do you want to go to? <select onChange="javascript:navigate(this.value);">
    <option>select...</option>
    <option value="home">home</option>
    <option value="profile">profile</option>
    <option value="canvas">canvas</option>
</select>
<br><br>
Passed param value: <input type="text" id="sParam1" style="background:#F0F0F0;" READONLY /><br>
Passed param value: <input type="text" id="sParam2" style="background:#F0F0F0;" READONLY /><br>
  ]]>
  </Content>
</Module>