i have a frame set where i load some pages like
Top -> Header
Left -> Menu
Right -> Data
but when i try to click on the menu the actual page has to be loaded in right side frame and it is not happening instead it is getting loaded in the left side frame and the menu is moved to right side.
I have given target=”rightSideFrame” but still it is not getting.
i create link for the menu in java code and i use struts1.2.9 frame work
Following is my code snipet :
HTML :
<frameset border="0" frameborder="0" framespacing="0" rows="64,*">
<frame border="0" frameborder="0" framespacing="0" id="topFrame" name="topFrame" src="<%=resourcePath%>/common/header.jsp" marginheight="0" marginwidth="0" noresize="noresize" scrolling="no">
<frameset border="0" frameborder="0" framespacing="0" id="MainFrameSet" cols="209,*">
<frame noresize="noresize" border="0" frameborder="0" framespacing="0" id="leftFrame" name="leftFrame" src="<%=resourcePath%>/common/left_menu.jsp" scrolling="auto">
<frame border="0" frameborder="0" framespacing="0" id="workFrame" name="workFrame" src="<%=resourcePath%>/common/WelcomePage.jsp" marginheight="7" marginwidth="7" noresize="noresize" scrolling="auto">
</frameset>
</frameset>
and Menu link:
<a href=\"#\" target=\"workFrame\" onclick=\"getMenuRequest('"+model.getResource_name()+"','goToHome')\">"+model.getMenu_name()+"</a>
UPDATE :
and getmenuRequest
function getMenuRequest(actionName,methodName){
document.forms[0].action=actionName+".htm";
document.forms[0].method.value=methodName;
document.forms[0].submit();
}
Please help me to resolve this,
Regards
The trouble is that the
targetproperty of your link is ignored as the javascript is submitting the form, you’d have to modify yourgetMenuRequestmethod to set theformtarget:There is one caveat though, if you submit the form later on other requests, it would still have a target of
workFrame, and may then target the wrong frame…N.B. I haven’t tried this…