4

I have written an extension using just javascript to allow users to rename favorites. The code seems to be working, the only thing missing at this moment is that the iFrame that contains the favorites is not 'refreshing', when I manually right click in the frame and choose 'refresh' my new names are showing.

Is there anyway to trigger the refresh of that frame?

5

You should be able to reload the iframe via:

document.getElementById('yourIFrameId').contentWindow.location.reload(true);

To grab the favorites iframe you should be able to do something like:

$('#FavoritesTree iframe').contentWindow.location.reload(true);

EDIT: As mentioned by Daryl, the above will just reload the entire UI in the iframe. The following code uses the API to unload the lists in the favorites which should cause them to reload... I've only tested real quick in the console though.

$models.getItem("cme:userfavs").unloadLists();

Hope that helps!

Edit (Daryl): For me my final solution was very close to Alex's reccomendation. I just had to get a different list, I used

$models.getItem("cme:shortcuts").unloadLists()

2
  • These frames are created via the Tridion interface so they do not have ID's attached to them. Also, it appears that when the page is reloaded it also does a redirect to the full interface, so I end up with a full interface inside a single frame, inside a full interface :) I need to find a way to activate the reload method in Tridion.
    – Daryl H
    Jul 9 '14 at 17:54
  • Ah, I completely forgot about that... I should've tested before posting!
    – Alex Klock
    Jul 9 '14 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.