• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling Action class in pop up window

 
Raghu Nathan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a requirement where when the user clicks a link, I have to open a pop up window. There will be a number of links and each one will pass a different id to the Action class of the child (pop up) page.
The catch is that I am not supposed to use query string - how can I achieve this?

Please let me know if you have a clue ... thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do this with:
  • Javascript by changing hidden form fields and the submitting the form from the onclick event of the hyperlink.
  • A front controller that reads the URL of the request and determines what action to take accordingly.

  •  
    Raghu Nathan
    Ranch Hand
    Posts: 44
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks for the response ...
    I had tried doing that - I submitted the page with different hidden ctrl values and in the (parent) action class I tried to forward it to the child action. However, when I did this, the parent window showed the child window contents and vice-versa! (I hope you are able to follow what I mean)
    I know I screwed up - but where, I am not able figure out.

    Thanks again

    My code in jsp

    function setValues(topId,sideId,type)
    {
    alert(topId);
    alert(sideId);
    alert(type);
    if (type == 'TRKCOMP')
    {
    document.forms[0].stSasId.value = sideId;
    document.forms[0].stObjId.value = topId;
    }
    else
    {
    document.forms[0].stSasId.value = topId;
    document.forms[0].stObjId.value = sideId;
    }
    document.forms[0].viewHistory.value = 'Y';

    openWindow('/vtcts/studentCompetencyHistory.do');
    //document.forms[0].submit();}


    Code in parent action class

    else if (screenParams.get("viewHistory") != null) {
    String strSasId = (String) screenParams.get("stSasId");
    String strObjId = (String) screenParams.get("stObjId");
    log.info("strSasId" + strSasId);
    log.info("strObjId" + strObjId);

    sessionManager.setAttribute("strObjId", new SessionObject(strObjId));
    sessionManager.setAttribute("strSasId", new SessionObject(strSasId));
    return mapping.findForward("viewHistory");
    }
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Pie
    Posts: 65125
    92
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Please use UBB code tags when posting code to preserve its formatting. I will not read unformatted code. Please read this for more info.
     
    Raghu Nathan
    Ranch Hand
    Posts: 44
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Sorry about that folks - I was not aware. Here is the code in JSP and Action Class in the meantime.



    Code in parent action class


    ---------
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic