NetTalk Central

Author Topic: How do I get out of Frames  (Read 8521 times)

Big Ian

  • Newbie
  • *
  • Posts: 31
  • I wonder what happens if I press this button
    • MSN Messenger - ian.holdsworth@gmail.com
    • View Profile
    • Email
How do I get out of Frames
« on: January 31, 2008, 08:24:58 AM »
Hi Gang

I doing a web server that has frames however sometimes I'd like to get rid of them or link to an external site without it loading in my frame

How do I do this?

TIA
Ian Holdsworth
Ram Ltd

Alan Telford

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
Re: How do I get out of Frames
« Reply #1 on: January 31, 2008, 12:15:34 PM »
I don't know all the settings, but if you set TARGET to "_blank", then it will open the URL in a new window without being inside your frame.

Alan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How do I get out of Frames
« Reply #2 on: January 31, 2008, 10:41:06 PM »
Hi Ian,

Alan's answer is a good one. Setting the target to '_blank' makes that URL open in a new window.

If your site has frames, and you want to make the frames go away and link to "jsut a page" in the _same_ browser window then set the target of the URL to '_top'.

Cheers
Bruce


Big Ian

  • Newbie
  • *
  • Posts: 31
  • I wonder what happens if I press this button
    • MSN Messenger - ian.holdsworth@gmail.com
    • View Profile
    • Email
Re: How do I get out of Frames
« Reply #3 on: February 04, 2008, 04:36:09 AM »
Thanks Bruce & Alan

That works great for most bits. 

However I can't set the target frame for a form coming off of a browse.

Cheers
Ian Holdsworth
Ram Ltd

Big Ian

  • Newbie
  • *
  • Posts: 31
  • I wonder what happens if I press this button
    • MSN Messenger - ian.holdsworth@gmail.com
    • View Profile
    • Email
Re: How do I get out of Frames
« Reply #4 on: February 04, 2008, 04:37:34 AM »
Oh and another bit I forgot

How can I detect if a forms running in a frame or not?

Cheers
Ian Holdsworth
Ram Ltd

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How do I get out of Frames
« Reply #5 on: February 04, 2008, 06:58:41 AM »
Hi Ian,

>> However I can't set the target frame for a form coming off of a browse.

Do you mean by this...
"I can't determine where the Form opens, when clicking on the Insert / Change button on a Browse"

or

"I can't determine the Frame where the Browse opens when clicking on the Save / Cancel button in a form"

>> How can I detect if a forms running in a frame or not?

Detect where, and why? You can detect in the code of a frame itself using JavaScript. However I'm not sure that's what you're alluding to.

On the server side you can't really tell because the browser doesn't tell you what it's gonna do with the page, it just asks for a page. Of course since you generated the URL in the first place, chances are you know what frame it's going into.

Cheers
Bruce



Cheers
Bruce

Big Ian

  • Newbie
  • *
  • Posts: 31
  • I wonder what happens if I press this button
    • MSN Messenger - ian.holdsworth@gmail.com
    • View Profile
    • Email
Re: How do I get out of Frames
« Reply #6 on: February 05, 2008, 02:30:20 AM »
Bruce

>>
Do you mean by this...
"I can't determine where the Form opens, when clicking on the Insert / Change button on a Browse"

or

"I can't determine the Frame where the Browse opens when clicking on the Save / Cancel button in a form"
<<

I meant that when you specify the "form control procedure" there is no "target frame" option

Basically I have a form where I'm displaying info that the user needs to peruse below the form it's self in order to fill in the form however constantly scrolling up & down proving to be something of a pain so I'd like to ditch the frames so at least the users stand a chance of being able to see some of the info and fill it in without scrolling down every 2 seconds.

>>
Detect where, and why? You can detect in the code of a frame itself using JavaScript. However I'm not sure that's what you're alluding to.

On the server side you can't really tell because the browser doesn't tell you what it's gonna do with the page, it just asks for a page. Of course since you generated the URL in the first place, chances are you know what frame it's going into.
<<

Basically if I've programatically logged someone off the login page is appearing inside the main frame I'd prefer it to be unframed as it looks untidy or at least take the header & footer off of it.  But then again maybe I should do a re-design & just have it as a control.

Cheers
Ian Holdsworth
Ram Ltd

Big Ian

  • Newbie
  • *
  • Posts: 31
  • I wonder what happens if I press this button
    • MSN Messenger - ian.holdsworth@gmail.com
    • View Profile
    • Email
Re: How do I get out of Frames
« Reply #7 on: February 05, 2008, 07:42:20 AM »
OK I did a redesign so the logging in problem has gone away.  However it would still be nice to get rid of the frames for one form.

Cheers
Ian Holdsworth
Ram Ltd

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How do I get out of Frames
« Reply #8 on: February 06, 2008, 04:29:34 AM »
Hi Ian,

So, just so I'm sure, what you're thinking of is

a) normal (framed) site with browse in say the Right_Frame
b) Go to Form, but at this point set target to '_top' (hence, just the form appears, no frame) then
c) On save (or cancel) jump back to the FrameSet procedure, and hence have the frames back, with the browse in the right hand side?

Cheers
Bruce

Big Ian

  • Newbie
  • *
  • Posts: 31
  • I wonder what happens if I press this button
    • MSN Messenger - ian.holdsworth@gmail.com
    • View Profile
    • Email
Re: How do I get out of Frames
« Reply #9 on: February 09, 2008, 04:56:00 AM »
Yep that's about right

Any Ideas?

BTW Is there something wrong with the forum as it seems to enjoy chucking me out and asking me the check my cookie settings (Cookies are on btw)
Ian Holdsworth
Ram Ltd

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How do I get out of Frames
« Reply #10 on: February 12, 2008, 07:49:56 AM »
Ok, I've made a change for you. This will apply to version 4.30, Pre-Release 7 and later.
(Which isn't yet uploaded - I'll do that later this week.)

I've attached a small example app, based on example number 4. I'm not gonna add another example to the shipping set for 4.30 so you'll probably want to use this.

a) If you go to the MailBoxesBrowseControl procedure, to the Form tab, click on the Advanced button. Here you can set the name of the Form, and the Target. In this example, the URL is set to
'MailboxesFormControl'
and the Target is set to
'_top'

b) In the MailBoxesFormControl the URL-on-save (and URL-on-Cancel) is set to 'FramePage'. The Target in both cases is set to '_top'.

c) In the Embeds of the MailBoxesformControl, In the PostInsert and PostUpdate routines, I've added a line of code;
  p_web.SetSessionValue('GoToBrowse','MailboxesBrowseControl')

d) In the FrameSet procedure there was already code to dynamically set the URL for the "Right_Frame". I extended this code to use the SessionValue, so it's now...

  if p_web.GetSessionLoggedIn()
    loc:RightURL = p_web.GetSessionValue('GoToBrowse')
    if loc:rightURL = ''
      loc:rightURL = 'IndexPage'
    end
  else
    loc:RightURL = 'HintPage'
  End

I'm not sure I really _like_ this approach, but I can see that in some cases it would work well.

Cheers
Bruce



[attachment deleted by admin]

Big Ian

  • Newbie
  • *
  • Posts: 31
  • I wonder what happens if I press this button
    • MSN Messenger - ian.holdsworth@gmail.com
    • View Profile
    • Email
Re: How do I get out of Frames
« Reply #11 on: February 13, 2008, 03:28:52 AM »
Thanks Bruce
Ian Holdsworth
Ram Ltd