
Announcements
I'm trying to use the Pivot control to allow users to navigate to another screen based on their selection.
The control is populated by a table created in OnStart:
Set(gblForms, Table(
{ID: 1, formName: "Referral", Screen:'Referral Screen'},
{ID: 2, formName: "Plan Recommendation", Screen:'Plan Recommendation Screen'},
{ID: 3, formName: "Progress", Screen:'Progress Screen'},
{ID: 4, formName: "Follow Up", Screen:'Follow Up Screen'})),
I have the Pivot control located in a gallery. I'd like to pass a key from the selected gallery item when the user chooses one of the options in the control.
The below option works fine, but I'm not passing a variable:
Navigate(pvt_Search_Forms.Selected.Screen)
If I try this, it throws an error:
Navigate(pvt_Search_Forms.Selected.Screen, Fade, {locCaseID: ThisItem.CaseID})
The error is: "Context variables cannot be used here. Context variables can only be bound to a single, specific screen."
If I use this code in the OnSelect function, it works fine but that kind of defeats the purpose of creating a table.
Switch(
Self.Selected.formName,
"Referral",
Navigate(
'Referral Screen',
ScreenTransition.Fade,
{locCaseID: ThisItem.CaseID,
locStudentID: ThisItem.StudentID}
),
"Plan Recommendation",
Navigate(
'Plan Recommendation Screen',
ScreenTransition.Fade,
{locCaseID: ThisItem.CaseID,
locStudentID: ThisItem.StudentID}
),
"Progress",
Navigate('Progress Screen',ScreenTransition.Fade,
{locCaseID: ThisItem.CaseID,
locStudentID: ThisItem.StudentID}),
"Follow Up",
Navigate('Follow Up Screen',ScreenTransition.Fade,
{locCaseID: ThisItem.CaseID,
locStudentID: ThisItem.StudentID}),
/* Default action */
false
)
I'd really like to use the Pivot control, but I'm not sure if I'm using the properties correctly or not. Betting on my prior performance, I'm betting that I'm not.
Thanks,
Steve