Skuid page in lightning component

  • 1
  • Question
  • Updated 3 years ago
  • Answered
  • (Edited)
How to pass parameter to <skuid:page page="TestPage"> in lighting
component i.e. need to pass id to the skuid page while using in a lightning component

<aura:application >
    <skuid:page page="TestPage"/>
</aura:application>
Photo of Paddy

Paddy

  • 70 Points

Posted 3 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
There are 3 attributes for the <skuid:page> Lightning Component that may be of use here:

- useURLParameters (Boolean, defaults to false): if you are passing URL parameters to this Lightning App and just want Skuid to have access to them like Skuid does automatically in Visualforce Pages, then set this to true
id(String): if you've got a Record Id in context that you want to access via the "id" parameter in your Skuid Page, set this attribute to the record Id. 

My guess is that these 2 attributes will do what you need. If there are other parameters you need to pass in to your Skuid Page, though, there's a 3rd, more general attribute that you can use to pass any number of arbitrary parameters into the Skuid Page:

 - parameters (JSON String): a JSON-formatted map containing any additional parameters you want to use in your Skuid Page.


Examples

Let's say that you are passing URL Parameters to your Lightning App like this:

https://acme.lightning.force.com/acmeWidgets/widgets.app?productFamily=Shoe

Then either of the following approaches for a page definition would allow you to access the "productFamily" Page/URL Parameter within your Skuid Page (with the first being much easier, of course):

<aura:application >
    <skuid:page page="TestPage" useURLParameters="true"/>
</aura:application>

<aura:application >
    <skuid:page page="TestPage" parameters='{"productFamily":"Shoe"}'/>
</aura:application>

Let's say that you had a record Id in context that you wanted to use, such as an Account Id. In this case you could just use the account's Id directly, e.g.

<aura:application >
    <skuid:page page="TestPage" id="{!accountId}"/>
</aura:application>