#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    0

    Script is not working in div popup


    Hi,
    I have a scenario where i will have to do a popup on click of button. I did a jsp as div popup where in that popup I have to use dojox.grid.DataGrid. But when popup comeup the script i wrote in the popup div jsp is not working. Dojo grid and css also not idetifying. Basically no script is working in popup jsp


    Thanks in advance.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,971
    Rep Power
    375
    how about posting the relevant code?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by paulh1983
    how about posting the relevant code?
    thanks for you reply.

    below is the code sample..


    when i see the response before show the popup whole jsp was there, showDiv just pushing whole jsp as poup.

    is there anyway can I make script work in the JSP header?


    function showEquipPopup(){ // calling on click of equipmentselect button

    var url = "EquipmentSelect";//EquipmentSelect.java
    var width = 700;
    height = 450;

    var page = "EquipmetnSelectPopup.jsp"

    var title = "Equipment Select:

    ShowEquipmentPopup(page, title, readOnly, url, width, height);


    return popup_id

    }


    function ShowEquipmentPopup(){


    var w = (width != null) ? width : 700;
    var w = (height != null) ? height : 450;

    var url="";

    setPopupCOntent(url); // JSp comoing as response

    var targetDiv = document.getElementById(Popup_content_id);

    if(targetDiv.innerHTML != ""){
    // setting buttons, title, width and height herer.
    }


    showPopup(popupWinId); // pushing whole jsp as a div popup
    }


    function setPoupContent(contentSrc){
    loadPopupCOntent(popup_content_id)
    }


    function showPopUp(PopupId){
    var popupWin = ocument.getElementById(popupWinId);

    if(popupWin != null){
    popuOn = true;
    zi=popup_zindex;
    }

    pupupWin.style=zIndex=zi;
    showDiv(popupWin, 'block');
    }

    }


    function loadPopupCOntent(targetDivId, contentSrc){

    var targetDiv = document.getElementById(targetDivId);

    if(targetDiv != null){

    var parent = targetDiv.parentNode;
    parent.removeChild(targetDiv);
    targetDiv = document.getElementById('div');
    targetDiv.id=targetDivId;
    ajaxGet(contentSrc, response, null, targetDiv, true);
    parent.appendChild(targetDiv)
    }
    }



    EquipmetnSelectPopup.jsp

    -------------------------


    <html>
    <head>

    <script LANGUAGE="javascript">
    // script , css imports and some script

    //inside script in head is not working at all

    alert("in head");
    </script>
    </head>
    <body>

    <form NAME="equipForm" METHOD="post" action="../equipSelect">



    //datagrid here

    </form>
    </body>
    </html>


    Thank you very much for your help in advance

IMN logo majestic logo threadwatch logo seochat tools logo