Reaching a sibling frame ?????

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Java_Forum

    Reaching a sibling frame ?????

    hi,
    here is my main html file

    INDEX.JSP
    -------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <META name="GENERATOR " content="IBM WebSphere Studio">
    <TITLE>main.htm l</TITLE>
    </HEAD>
    <frameset name = "index" cols="163,*" border="0" frameborder="no ">
    <frame name="menu" src="menu.jsp" noresize scrolling="no"/>
    <frameset rows="30,*" border="0" frameborder="no ">
    <frame name="header" src="header.jsp " noresize scrolling="no"/>
    <frame name="body" scrolling="yes"/>
    </frameset>
    </frameset>
    </HTML>

    what i want to do is to refresh the 'menu' frame form within the 'body'
    frame.
    in the body frame, i have my loggon form, when the logging succed, i display
    a welcom file "welcomUser.jsp ' in the 'body'. and i have created a
    javascript
    called at onLoad of welcomUser.jsp

    WELCOMEUSER.JSP
    --------------------------

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@page import="eshop.u til.*"%>
    <HTML>
    <HEAD>
    <META name="GENERATOR " content="IBM WebSphere Studio">
    <TITLE>acceuilU sert.jsp</TITLE>

    <SCRIPT language="JavaS cript">
    function reloadMenu()
    {
    parent.menu.loc ation.href = "menu.jsp";
    }
    </SCRIPT>

    </HEAD>

    <BODY onLoad="reloadM enu()">
    <%
    String name="";
    if (session != null) {
    User user = (User) session.getAttr ibute("user");
    if (user != null)
    name = user.getName();
    }
    %>

    welcome <%= name %>
    </BODY>
    </HTML>

    THE ERROR
    ---------------
    parent.menu.loc ation null object
    i have tried also parent.parent.m enu.location, with no success
    PLEASE HELP, i have a big headache i don't understand i have drawn the
    hierarchy structure!!!! i don't understand
    in my opinion the hierarchy structure is as follow

    FramSet-Top
    Frame-Menu FrameSet
    Frame-header
    Frame-body

    so to reach the Menu frame from the body-frame, there is tow steps to reach
    FramsetTop (parent.parent) , and finally to reach menu is
    (parent.praent. menu)
    but it doesn't work -;((((

    THANKS FOR YOUR HELP


  • Java_Forum

    #2
    Re: Reaching a sibling frame ?????

    i am very shamed , i have test the WelcomUser.jsp outside of its context, so
    of course there is no parent
    ok forget about it

    "Java_Forum " <hbekkali@wanad oo.fr> a écrit dans le message de news:
    bj7pt0$crr$1@ne ws-reader3.wanadoo .fr...[color=blue]
    > hi,
    > here is my main html file
    >
    > INDEX.JSP
    > -------------
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    > <HTML>
    > <HEAD>
    > <META name="GENERATOR " content="IBM WebSphere Studio">
    > <TITLE>main.htm l</TITLE>
    > </HEAD>
    > <frameset name = "index" cols="163,*" border="0" frameborder="no ">
    > <frame name="menu" src="menu.jsp" noresize scrolling="no"/>
    > <frameset rows="30,*" border="0" frameborder="no ">
    > <frame name="header" src="header.jsp " noresize scrolling="no"/>
    > <frame name="body" scrolling="yes"/>
    > </frameset>
    > </frameset>
    > </HTML>
    >
    > what i want to do is to refresh the 'menu' frame form within the 'body'
    > frame.
    > in the body frame, i have my loggon form, when the logging succed, i[/color]
    display[color=blue]
    > a welcom file "welcomUser.jsp ' in the 'body'. and i have created a
    > javascript
    > called at onLoad of welcomUser.jsp
    >
    > WELCOMEUSER.JSP
    > --------------------------
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    > <%@page import="eshop.u til.*"%>
    > <HTML>
    > <HEAD>
    > <META name="GENERATOR " content="IBM WebSphere Studio">
    > <TITLE>acceuilU sert.jsp</TITLE>
    >
    > <SCRIPT language="JavaS cript">
    > function reloadMenu()
    > {
    > parent.menu.loc ation.href = "menu.jsp";
    > }
    > </SCRIPT>
    >
    > </HEAD>
    >
    > <BODY onLoad="reloadM enu()">
    > <%
    > String name="";
    > if (session != null) {
    > User user = (User) session.getAttr ibute("user");
    > if (user != null)
    > name = user.getName();
    > }
    > %>
    >
    > welcome <%= name %>
    > </BODY>
    > </HTML>
    >
    > THE ERROR
    > ---------------
    > parent.menu.loc ation null object
    > i have tried also parent.parent.m enu.location, with no success
    > PLEASE HELP, i have a big headache i don't understand i have drawn the
    > hierarchy structure!!!! i don't understand
    > in my opinion the hierarchy structure is as follow
    >
    > FramSet-Top
    > Frame-Menu FrameSet
    > Frame-header
    > Frame-body
    >
    > so to reach the Menu frame from the body-frame, there is tow steps to[/color]
    reach[color=blue]
    > FramsetTop (parent.parent) , and finally to reach menu is
    > (parent.praent. menu)
    > but it doesn't work -;((((
    >
    > THANKS FOR YOUR HELP
    >
    >[/color]


    Comment

    • kaeli

      #3
      Re: Reaching a sibling frame ?????

      In article <bj7pt0$crr$1@n ews-reader3.wanadoo .fr>, hbekkali@wanado o.fr
      enlightened us with...[color=blue]
      > <frameset name = "index" cols="163,*" border="0" frameborder="no ">
      > <frame name="menu" src="menu.jsp" noresize scrolling="no"/>
      > <frameset rows="30,*" border="0" frameborder="no ">
      > <frame name="header" src="header.jsp " noresize scrolling="no"/>
      > <frame name="body" scrolling="yes"/>
      > </frameset>
      > </frameset>
      > </HTML>
      >
      > what i want to do is to refresh the 'menu' frame form within the 'body'
      > frame.[/color]

      <script type="text/javascript">
      top.frames["main"].reload()
      </script>

      -------------------------------------------------
      ~kaeli~
      Press any key to continue or any other key to quit.
      Who is General Failure and why is he reading
      my hard disk?


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

      Comment

      Working...