function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jason SledgeJason Sledge 

How do I turn a datatable on and off within a VF page using a Flow variable?

I've created a Visualforce page (and simple getter/setter class) that hosts a Flow and renders a couple of dataTables by passing sObject Collection variable data to the page. One thing I'm trying to do that would really enhance the flow is to pass a couple of boolean or text variables from the flow to the VF page and use them as the "rendered=" value of each dataTable to turn them on and off from within the flow.

I've created a variable in the VF page:
<apex:variable var="renderPanel" value="{!myflow.RenderContactsPanel}"></apex:variable>

For the datatable, I plug that variable into the "rendered=" parameter:
​<apex:dataTable value="{!myflow.sc_ContactsInAccount}" var="contact" rowClasses="odd,even" border="1" cellpadding="4" rendered="{!renderPanel}" >
In the flow itself, RenderContactsPanel is a variable set to "true" or "false" at different points in the flow, depending on where the flow is using an Assignment logic. I've tried the RenderContactsPanel variable as both a boolean and a text variable (when text, it gets assigned to a Text Template with content="true" or "false") and regardless, the dataTable remains unrendered.

Any insight on the correct approach to this problem would be appreciated.
AdamDawAdamDaw
Is there any way  you can pass these as URL Parameters? If so, you could then access them using the VF reference for the URL params?
Jason SledgeJason Sledge
I think that's a good suggestion but I don't think I would be able to pass a URL to have that variable turn off a dataTable depending on which node the user is at in the flow.  In other words if a URL were passed it would refresh the page and restart the flow but what I want it to do is to have the flow determine when to render (or to not render) certain things (like sectionHeaders/dataTables etc).