In my app's .js file, I have something similar to the following
$(document).on('pagebeforeshow', function() {
// create dynamic header
$('.header').trigger('create');
});
The above gets called when transitioning to a new page. This works fine.
However, on a particular page, in the <div data-role="content"> part of the page, i have the following:
<script>
$('#uniquePageId').on('pagebeforeshow', function() {
// create a form and its form elements dynamically using jsrender
$('#divThatContainsForm').trigger('create');
});
</script>
So essentially .trigger('create') is being called twice for this one particular page, once for the dynamic header and once for the dynamic form.
In Chrome's Ripple emulator, it works fine.
However, when I try in a Blackberry7 simulator (for the 9810), the header renders fine, but the form content does not. The form and its elements appear to be hidden (not visible), but if I click around on the page and happen to click on one of the dropdowns, the dropdown's options appear. When I select one, the dropdown options disappear and the page is again blank (specifically, none of the form elements are appearing).
If I remove the 2nd .trigger('create') for the dynamic form elements, they appear, but do not have the JQM styling applied.
There is no output in the BB simulator's output/debug log, so I have no clue what is happening in the simulator.
Tomorrow, I'm going to try on the iOS simulator to see if the problem exists there too.
Does anyone know what might be causing this issue? It seems to be something with calling .trigger('create') twice for a single page, but I do not know why this would happen.
Any advice/suggestions would be greatly appreciated.
Thanks in advance.