Support Article
Section with custom control shows XML error
SA-2140
Summary
Section rules with custom control fail to open in Designer Studio. It shows an error:
Error: Did not receive valid XML from server.
Error Messages
Error:Did not receive valid XML from server.

Steps to Reproduce
1) Create a custom Control with Pega:withPage tag and Pega:When tag.
2) Use the Control in a Section.
3) Open the Section in Design Mode and the error appears.
Root Cause
The root cause of this problem is a backwards compatibility issue with PRPC code/rules compilation.
PRPC 6.1 SP2 and later releases have preview feature and hence, ‘Design Mode’ checks for the page to exist as well so that the control renders in section in ‘Design Mode’ as well.
Resolution
This issue is resolved through the below snippet which prevents code from executing a set of codes in ‘Design Mode’.
<pega:choose>
<pega:when java='<%= tools.findPage("pxRequestor").getString("pyPegaDesignMode").equals("false") %>' >
//Code Referencing
</pega:when>
</pega:choose>
The same snippet has been included as part of out of the box codes as well to prevent runtime references from being compiled in ‘Design Mode’.
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.