0

I have a mainscreen with 2 iframes. In iframe named (and also id) "leftmenu" I load frmLeftMenu.php and in the second iframe named (and also id) "appscreen" I load frmAppScreen.php.

In the frmLeftMenu.php I have a tree menu (dhtmlX) and on the onclick event I want to load a page in the iframe named "appscreen". The handling of the onclick is made in the frmLeftMenu.php.

What is the best way to do this?

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
Protinus
  • 3
  • 1
  • Try this logic. on clicking the menu, save the name of the page (that is to be loaded in the 2nd iframe) in a hidden field. From the parent page, use set interval to check if the hidden field value has changed. if so then change the src attribute of the 2nd iframe. – I'm nidhin May 08 '15 at 11:33
  • do you really want to use iframes? http://stackoverflow.com/questions/23178505/good-reasons-why-not-to-use-iframes-in-page-content/23178537#23178537 ... would you consider others options? – bovino Marcelo Bezerra May 08 '15 at 12:48
  • All options are still open. @MarceloBezerra – Protinus May 08 '15 at 13:18

1 Answers1

0

I found the solutions. on the onclick I execute a function named DoOnclick. There I'm testing the id from the menu items and then execute a window.open("formname.php","appscreen"); This is working well for my application.

code example:

        myTree.setOnClickHandler(DoOnclick);
        function DoOnclick(id){

            switch(myTree.getSelectedItemId()){
                case 'adm_users'  : window.open("frmUserMaintenance.php", "appscreen");                    
                                    break;                                   
            }

        };            
Protinus
  • 3
  • 1