What's the best way to clear the iframe?
I need to load my entire app in order to get certain dependencies (the localized strings) but that causes the whole app to render in the iframe. In order to test smaller components I would like to clear the iframe so that I can display the components I'm testing.
Support Forum
I'm only testing one component. The problem is that I need to load the app to get the localized strings that are used by that component. Those strings are served up via a jsp file that uses spring. See https://forum.bryntum.com/viewtopic.php?f=20&t=2033
If I don't have those strings, then the references to those string yield 'undefined' errors.
And of course when I load the app it renders in the iframe. If there is a way to load the jsp page without displaying it, then that would be good enough.
If I don't have those strings, then the references to those string yield 'undefined' errors.
And of course when I load the app it renders in the iframe. If there is a way to load the jsp page without displaying it, then that would be good enough.
Can you serve those localization strings as the separate jsp file? So instead of
you can do:
And in this way you can just include "path/to/localization_script.js" to your preloads.
<script type="text/javascript">
TR = {
AccessionEmptyText: '<spring:message code="home.AccessionEmptyText" javaScriptEscape="true"/>',
}
</script>
<script type="text/javascript" src="path/to/localization_script.js"></script>
Read the API documentation
Hi Nickolay,
I've tried something similar to that. JSP has a construct called a 'JSP Fragment', a .jspf file, that I can create and it contains only the TR definition
A fragment can be included in multiple jsp files with a line that looks like .
So I include it in my app's jsp file and also in a new jsp file called tr.jsp. Then I set the hostPageUrl for my test to load tr.jsp and I get the strings I need. This works, though it seems like a bit of a backdoor use of hostPageUrl.
I've tried something similar to that. JSP has a construct called a 'JSP Fragment', a .jspf file, that I can create and it contains only the TR definition
<script type="text/javascript">
TR = {
AccessionEmptyText: '<spring:message code="home.AccessionEmptyText" javaScriptEscape="true"/>',
}
</script>
<%@include file="myFragmentFile.jspf" %>
So I include it in my app's jsp file and also in a new jsp file called tr.jsp. Then I set the hostPageUrl for my test to load tr.jsp and I get the strings I need. This works, though it seems like a bit of a backdoor use of hostPageUrl.