No announcement yet.

Refresh other object in the same container

  • Filter
  • Time
  • Show
Clear All
new posts

  • Refresh other object in the same container


    I have two objects in the same container, X1 and X2, but after finish the first object X1 (type control) i need to refresh the second object (type blank) because this is a calendar, How can i do this?


  • #2
    That is not easy as each element in the container is an IFrame and not a Div. You can set one of the containers to be refreshed automatically each xx seconds. To pass the data of the other frame you can use session global variables.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development /


    • #3
      Thanks Albert, but yes, i am looking one solution different to the refresh automatic of the container.

      Somebody have other solution?



      • #4
        Hi Navegator,
        You can call a javascript function created by you to change the URL of an iframe, each iframe on a container has an unique ID so you can change the location.
        function iframeGOTO(iframeID,url){
        Best Regards
        Hiram BQ


        • #5
          Yes that's a great way of doing it. But it requires some hacking to get the ID, but that's not too difficult. My fear is that the unique id might change in situations?
          Albert Drent
          aducom software netherlands
          scriptcase partner, reseller, support and (turn-key) development


          • #6
            Thanks Hiram and Albert

            Using the Chrome's debugger i have this information about the iframe:

            <ul id="column2" class="column" style="width: 34%">

            <li class="scContainerWidget widget" id="widget2">
            <div class="widget-head scContainerTitle">
            <h3 id="id-title-widget2"></h3>
            <div class="widget-content" style="height: 450px; padding: 0px">
            <iframe id="id-iframe-widget2" class="sc-iframe-widget" style="height: 100%; width: 100%; border: 0px" src="/scriptcase/app/Asistencia/Blank_Calendario_Kool/Blank_Calendario_Kool.php?script_case_session=bv30 11ecc280li7o4b0hoqafm6" alt="30"></iframe>


            Then the id of the iframe is: id-iframe-widget2

            How can i refresh this iframe since other object?



            • #7
              I'm not sure, but I would guess calling IFrameGoto('id-iframe-widget2','the-url-of-your-page.php'); You need to add the javascript to your application and there's a sc_macro to call a javascript function (sc_ajax_javascript ( 'JavascriptMethodName', array("parameter"))). I must be honest, I'm not a javascript guruu, so I hope that hirambq can answer this question more acurately. I try to avoid using javascript as much as possible.
              Albert Drent
              aducom software netherlands
              scriptcase partner, reseller, support and (turn-key) development


              • #8
                In theory, it should work in a way like the container refreshing described in this tutorial:

                Except in your case, your trigger for the javascript might not be the onclick event of a user clicking a button, but maybe on the onload of the first app? Maybe put something like this to trigger it off without human clicking?

                I have never had the id of an iframe change unless you add some type of app or something else that causes an iframe change of some kind. So you should be able to rely on that id. I have not had a problem with that.

                Good luck on your calendar - I have a lot of calendars in my app too


                • #9
                  Thanks Jamie, the tutorial is very clear, but i feel that in my case is not easy to get the id of the iframe. The iframe is inside of one container, this container is inside one menu, the menu is inside one tab and the tab is inside of other container.

                  Better i redesign the app. Moreover, my calendar is special because the color of the each one cell depends upon certain information.



                  • #10
                    you are using ifarame in inside the container but google can create issues with your website because google don't like to use iframe.Google black list my domain due to iframe.I used iframe many times in my website so i suggest you to read terms and condition of google carefully before using iframe