Solved

Frame Creation & Recreation

Posted on 2004-10-14
11
193 Views
Last Modified: 2006-11-17
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?
0
Comment
Question by:LarryAndro
  • 7
  • 4
11 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 12309180
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.
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12309182
or you could use an IFrame in the work frame document.
0
 
LVL 1

Author Comment

by:LarryAndro
ID: 12309642
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.
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12311002
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?

0
 
LVL 1

Author Comment

by:LarryAndro
ID: 12311137
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.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 33

Accepted Solution

by:
knightEknight earned 500 total points
ID: 12311203
in general, you would change the src file of the text frame from "welcome.htm" to a new file, say we call it "textFrames.htm" when this option is chosen.
I assume the option is chosen from the menu frame by a link.  If so, do this:

<A href="textFrames.htm" target="text">Option</A>

in the textFrames.htm file you have another frameset:

<FRAMESET  cols="100%" rows="*,48">
  <FRAME name="topText" src="topText.htm">
  <FRAME name="bottomText" src="bottomText.htm">
</FRAMESET>


then when you are ready to leave the option, reset the text frame back to a normal html file:

<A href="welcome.htm" target="text">Welcom</A>

0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12311215
this can also be done with javascript if necessary ... syntax:

   top.frames["text"].location = "textFrames.htm";
0
 
LVL 1

Author Comment

by:LarryAndro
ID: 12311906
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...)
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12311943
>> 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.
0
 
LVL 1

Author Comment

by:LarryAndro
ID: 12312671
More than cool!  Thanks...
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12318346
I hope it helps!  Thanks for the A!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now