0

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.

1

In the apex:dataTable I would expect to see:

rendered="{!renderPanel}"

(with RenderContactsPanel a Boolean) or just:

rendered="{!myflow.RenderContactsPanel}"
  • Thanks for the reply, Keith. After I peeled my palm from my face I tried both of what you suggested and I'm receiving the error "Cannot convert the value of '{!renderPanel}' (or {!myflow.RenderContactsPanel} when I tried that) to the expected type." I've tried using both boolean and string variables in the flow in case the boolean wasn't being translated by the VF page as "true" or "false" and it doesn't seem to like either. Any ideas why that would be happening? – FlowUser Jan 4 '16 at 16:34
  • @FlowUser Are you sure both values are of type Boolean? – Keith C Jan 4 '16 at 16:36
  • Yep, I triple-checked and the flow variables are both boolean. I tried changing them to Text and assigning using one of two text templates, either "true" or "false" and I get the exact same result. – FlowUser Jan 4 '16 at 17:32
  • @FlowUser OK I'm stumped... – Keith C Jan 4 '16 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.