Passing params on installation

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Passing params to another view" description="" screenshot="" author="" author_email="" 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 the firebug add on in Firefox
		if (window.console && window.console.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="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>

Note: If you want to use this as a way to personalise your gadget you'll need to store the appParams as appData to ensure that this data is not lost after the initial installation. More information on appData can be found here.

Example install (Make sure you're not in OpenSocial Sandbox mode)

Example file