0

I created a dynamic component:

 public Component.Flow.Interview getFlow() {
        Component.Flow.Interview flow = new Component.Flow.Interview();
        flow.name = xx.Flow_Name__c;
        return flow;
    }

and my visualforce page is:

<apex:page controller="Sample1" >


<apex:outputPanel id="textPanel" layout="block" style="height:100px;background-color:#{!xx.Header_Color__c}" > 
<apex:outputText style="font-size:250%;margin:10px;" value="{!xx.Tag_Line__c}"></apex:outputText>
<apex:outputText style="display:block;margin:10px;" value="{!screenLabel}"></apex:outputText>
</apex:outputPanel>
<apex:outputPanel id="component">
<apex:outputPanel rendered="{!componentRender}">
<apex:dynamicComponent componentValue="{!flow}" />
</apex:outputPanel>
</apex:outputPanel>
<apex:form >
<apex:outputPanel layout="block" style="height:100px;background-color:#{!xx.Footer_Color__c}" />
<apex:outputPanel id="ddff" />
<apex:outputPanel id="flowPanel">
<apex:outputPanel rendered="{!NOT(rendering)}">
<apex:actionFunction name="receiveFile" action="{!receiveMetadataZipFile}" rerender="ddff" oncomplete="unzip();">
      <apex:param name="filename" assignTo="{!MetadataFileName}" value=""/>
      <apex:param name="filedata" assignTo="{!MetadataFileData}" value=""/>
</apex:actionFunction>  
 <apex:actionFunction name="receiveComplete" action="{!receiveComplete}" rerender="flowPanel,textPanel,component" />

</apex:outputPanel>
</apex:outputPanel>

<apex:outputPanel >
<apex:actionPoller interval="5" action="{!checkStatus}" rendered="{!rendering}" rerender="flowPanel" />
</apex:outputPanel>
</apex:form>

</apex:page>

When receivecomplete get called its give me error Internal server error. Below is screenshot of internal server error. If I change its definition from:

<apex:actionFunction name="receiveComplete" action="{!receiveComplete}" rerender="flowPanel,textPanel,component" />

to:

 <apex:actionFunction name="receiveComplete" action="{!receiveComplete}" rerender="flowPanel,textPanel,component" />

then there is no error but component panel is not rerendering. Please help how to avoid this error?

1 Answer 1

1

Your two apex:actionFunction versions look the same to me...

As the Component.Flow.Interview is not part of the view state (and can't be because it isn't serializable), when you re-render at best you will get back to the original state when the page first opened. Is that what you are aiming to do? (And at worst perhaps the 500 error you are seeing.)

To get more information about the error screen that you show, you need to create a case with Salesforce support and quote the Error ID numbers. This allows support to check the internal log files that are created when this sort of unhandled error is generated in the platform and then sometimes provides useful information back to you.

3
  • No, i am trying to get on the first screen of the flow.When first page opens componentRender is false so there is nothing.but when it renders it will give first screen of flow. Commented Jul 16, 2014 at 15:31
  • Is there anything wrong in rerendering a dynamic component ?? Commented Jul 16, 2014 at 15:35
  • @user133421 As the root object Component.Flow.Interview will be completely re-created on the re-render (whereas other page components are restored into the controller from the view state in the page, potentially updated and then pushed back into page vie state to preserve the state) if I was working on this I would be concerned about how it would work. But personally I have now experience of flows - perhaps someone who has can comment.
    – Keith C
    Commented Jul 16, 2014 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .