Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • marthin 87 posts 106 karma points
    Oct 14, 2010 @ 14:41
    marthin
    0

    openModalWindow callback?

    Hi,

    im using the following javascript to open a modalwindow when a link i clicked. I whant that window to return a string back to the page and update its content.

     

    function GetModal()
    {
        UmbClientMgr.openModalWindow('eCommerce/dialogs/GetMediaItem.aspx' , 'Get image', true,  400, 450, '', '', '', imback);
       
    }

    function imback(strId)
    {   
        alert("id: " + strId);
        jQuery("#imageContentHolder").append("<strong>"+strId+"</strong>");
    }

    This dosent work as I whant it to. The alert box pops up when i close, but the jquery append doesnt work? And also the object that is returned is some kind of javascript obejct, not a simple string??

    Can someone please explain how to work with this? Im simply put trying to open a modal -> return a value to page -> and update the page without a reload.

     

    Thx for any help

    Marthin

  • Allan Joey Laluan 24 posts 105 karma points
    Nov 06, 2010 @ 18:09
    Allan Joey Laluan
    0

    Hi,

    I encountered your problem and this is how I resolved it, I don't know if it's the best way but it works anyway.

    In my modal window page I added this javascript:

    function updatePicker() {
        parent.right.updateThumbnail(path);
        UmbClientMgr.closeModalWindow();
    }

    And this javascript is included in my calling page

    function updateThumbnail(path) {
        alert(path);
    }

    Hope this will help you out.

    Regards,

    aj

  • Allan Joey Laluan 24 posts 105 karma points
    Nov 06, 2010 @ 18:51
    Allan Joey Laluan
    0

    Hi,

    You can also do this.

    /* MODAL WINDOW CODE */
    function
    updatePicker() {
        parent
    .right.updateThumbnail(path);
    }
    /* CALLING PAGE */
    function
    updateThumbnail(path) {
        alert
    (path);
    UmbClientMgr.closeModalWindow();
    }

     

    Regards,

    aj

  • marthin 87 posts 106 karma points
    Nov 07, 2010 @ 20:57
    marthin
    0

    Okej, thx Allan.

Please Sign in or register to post replies

Write your reply to:

Draft