Finally got some time to breath and can give you all the update
on how to pass query parameters from an activity to the application
canvas page. The trick is to use the query parameter appParams on
the href, and pass on a json-like structure.You can pass multiple
values. In the example below I will pass on two parameters 'a'
and'b' with the respective values 'a value' and 'b value'
Imaging I define a tempate as
${subject}
rated the car <a
href='${canvasUrl}&appParams=${params}'>${carModel}</a>
Subject and canvasUrl are system variables, so when
raising the event I only have to define a value for "params"and
"carModel":
params[opensocial.Activity.Field.TEMPLATE_PARAMS] =
{
"carModel": "Toyota",
"params": "{\"a\":\"a value\", \"b\": \"b
value\"}"
};
This will result on a url target for 'Toyota'
http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=120604&appParams={%22a%22:%22a%20value%22,%20%22b%22:%20%22b%20value%22}
The values from the query parameter can be retrieved by
your javascript code
var param_value =
gadgets.views.getParams().appParams;
//or directly
var a_value = gadgets.views.getParams().a;
If you get these query parameter onLoad, you
can directly go to your relevant page section.
Hope this helps.
Marco