collapsible structure not getting displayed under dynamically modified collapsible set

collapsible structure not getting displayed under dynamically modified collapsible set

I have a collapsible set as mentioned below to which i dynamically add several collapsible's which also contain dynamic content. The issue is that I add collapsible structure to the collapsible set first and then add dynamic content to that collapsible structure. After adding the content to that collapsible I  modify as below
$("#struct0").appendTo( ".ui-page" ).trigger( "create" );
where struct0 is the id of the dynamically created collapsible.This helps in jqm applying styles to that collapsible content but the collapsible external structure is not formed.
Even when i call $("#accordionStr").collapsibleset('refresh'); the collapsible structures are not rendered
      

<div data-role="collapsible-set"  id="accordionStr">
 </div>

Can someone help me on this. I will attache the entire html file that i used for testing this.