I have a page (with no frames) that opens a child window using JavaScript and struts, like this:
window.open(“aa.do”, “child”, “<parameters for the window…>”);
that works fine. The struts action ‘aa’ executes its server-side code, then presents a window with two frames. The top is a JSP with two buttons; the bottom is a PDF referred to by URL. This all works.
I want one of the buttons in the JSP portion to invoke another struts action; I want the action to produce another very similar two-frame page, with a one-button JSP (or html) on the top and a (different) PDF via url on the bottom.
If I do the same javascript as above to produce the 2nd window, like this:
window.open(“bb.do”, “child”, “<parameters…”);
it appears the server does not recognize “bb.do” as a struts action. It attempts to find “/pages/bb.jsp”, where “/pages” is the location of my JSP pages for the app, including the “mother” page that started things off and the JSP that contains the button that caused this 2nd window.open call.
I tried eliminating the javascript and just having the button submit the html form that is in the top JSP. This causes the 2nd two-frames ‘window’ to appear in the TOP window of the 1st two-frames window. I’ve written javascript that eliminates the bottom frame, but after that executes it does not seem to execute the script part that submits the form.
It is not sufficient for me to present HTML out of the 1st two-frame window — I need the struts action so that it can do database things.
Can someone please tell me how to open the 2nd two-frame window?
I suppose it is ok if the 2nd one appears in a NEW window, as long as I can then eliminate the 1st window and not make the user do it. I’m afraid I’m stuck with creating a child window for the 1st two-frame item; I’m duplicating functionality that already exists, and the users will expect it to work that way. If it had been me writing it originally, I’d’ve put the first two-frame job in the original browser window instead of opening up a child. Ah, well.
I find this a difficult thing to search for — “javascript frames struts” gives many many references in lots of places, but I haven’t found anything that really addresses this situation yet…
rc