Refresh other object in the same container

Hi

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?

Thanks

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.

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

Somebody have other solution?

Regards

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.


<script>

function iframeGOTO(iframeID,url){
      $("#"+iframeID).attr('src',url);
}

</script>

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?

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>
<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=bv3011ecc280li7o4b0hoqafm6" alt=“30”></iframe>
</div>
</li>

</ul>

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

How can i refresh this iframe since other object?

Thanks!!

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.

In theory, it should work in a way like the container refreshing described in this tutorial: http://www.scriptcase.net/scriptcase-samples/tutoriais/features/samples_container_param.php

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? http://stackoverflow.com/questions/3842614/how-to-call-a-javascript-function-on-page-load

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 :slight_smile:
Jamie

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.

Carlos

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