Link to home
Start Free TrialLog in
Avatar of LarryAndro
LarryAndro

asked on

Frame Creation & Recreation

My application is a fairly typical menu-driven web application.  I am using framesets and frames, with a horizontal title page, and the menu in a left column frame.  The largest frame is my "work frame" and is where most option work occurs.  My question focuses on this work frame.

As stated above, most options use the work frame as created when the web application is initialized.  However, for one option I need to divide the work frame into two frames.  Then, when I go back to other options, I need the work frame reset to just one frame.

Is this possible?
What technique do I use to create two frames within the work frame?
What technique do I use to create one frame in the work frame instead of two?
Avatar of knightEknight
knightEknight
Flag of United States of America image

You could make the source file of the work frame another frameset file -- just for the duration of this option.
Show us your frameset code.
or you could use an IFrame in the work frame document.
Avatar of LarryAndro
LarryAndro

ASKER

I'm unfamiliar with IFrame, but will read up on it now.  

You said... You could make the source file of the work frame another frameset file -- just for the duration of this option.

This seems to imply that I can reconfigure a frame multiple times, which would be the solution for my problem.  (If so, could you tell me how to reconfigure just the work frame?)

Including my frameset file below, and ignore the floating part.

//FrameCreate....    Originally InvokeScript.js

if (self.name == 'menu') {
    // Sometimes, Netscape will try to load this index inside the menu frame.  I haven't
    // worked out why but this will detect that situation and reset the location property.
    self.location.href = "menu.htm";
} else {
    //Call to MenuTree.js by initialise changed to code embedded in index.jsp - LJA
    //initialise();

    var thePage = pageFromSearch('home.htm', theMenu, true);
   
    if (floatingMode) {
        self.document.writeln('<frameset cols="100%" rows="*,48" onUnload="unloadFloating();" onResize="defaultResizeHandler();">');
        self.document.writeln('<frame name="menu" src="menu.htm" scrolling="auto" marginwidth="1" marginheight="1" APPLICATION="yes">');
        self.document.writeln('<frame name="menuCntrl" src="menucntrl.htm" scrolling="no" marginwidth="0" marginheight="0" APPLICATION="yes">');
        self.document.writeln('</frameset>');
    } else {
        self.document.writeln('<frameset cols="100%" rows="70,*" onResize="defaultResizeHandler();" frameborder="0">');
            self.document.writeln('<frame name="title" src="title.htm" scrolling="no" noresize marginwidth="0" marginheight="0" APPLICATION="yes">');
        self.document.writeln('<frameset cols="250,1,*" rows="100%">');
        self.document.writeln('<frameset cols="100%" rows="*,48">');
            self.document.writeln('<frame name="menu" src="menu.htm" scrolling="auto" marginwidth="5" marginheight="5" APPLICATION="yes">');
            self.document.writeln('<frame name="menuCntrl" src="menucntrl.htm" scrolling="auto" marginwidth="5" marginheight="1" APPLICATION="yes">');
        self.document.writeln('</frameset>');
            self.document.writeln('<frame name="hline" src="horizline.htm" scrolling="auto" marginwidth="5" marginheight="1" APPLICATION="yes">');
            self.document.writeln('<frame name="text" src="welcome.htm" scrolling="auto" marginwidth="5" marginheight="1" APPLICATION="yes">');
        self.document.writeln('</frameset>');
        self.document.writeln('</frameset>');
    }
}

My work frame is <frame name="text"...>.  This is the frame I want to reconfigure to be two frames later, and reconfigure again back to the above.
I see the following frame names:  title, menu, menuCntrl, hline, text

which of these frames is your "work frame" -- the one you want to split?

My work frame is 'text.'  The frameset and frames above are used when the web app initially opens.  But, if the user selects one of the menus in the menu tree I want to split up the 'text' frame into two frames.  After exiting that option, I want to reframe 'text' from two frames back to the one (original) frame.
ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
this can also be done with javascript if necessary ... syntax:

   top.frames["text"].location = "textFrames.htm";
Sounds like it's as easy as I hoped it would be.  Basically, the FRAMESET/FRAME configures the window that is active at the moment of execution.  When the web app is invoked, the entire screen is the context and so that's what is configured.  But, when I click the link and navigate to my 'text' frame, that becomes my environment, and so any FRAMESET/FRAME issued will section up 'text.'

Do I understand so far?  What I don't understand is the exit action where I would collapse my two frames into one frame.  What I think you're implying is the following...

* 'text' frame created initially.
* 'text' frame area reframed into two frames...  'topText' and 'bottomText'
* 'text' frame not destroyed by creation of other two frames, even though 'text' geographical area is "overwritten"
   by two new frames.  So, 'text' frame still available for use.

Are you saying that the creation of 'topText' and 'bottomText' is not destructive of 'text'?

(Increasing points...)
>> Are you saying that the creation of 'topText' and 'bottomText' is not destructive of 'text'?

yes, everything you said is correct.  If the page loaded into the "text" frame has itself a set of frames, then those frames will be displayed inside the "text" frame.  To "un-do" this effect, simply reload the "text" frame with a normal HTML file.   The mechanics of how to do all this depend on your specific application -- e.g. how you switch "options" in the "text" frame now.
More than cool!  Thanks...
I hope it helps!  Thanks for the A!