NetTalk Central

Author Topic: How to display static html page  (Read 4312 times)

alan

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • Email
How to display static html page
« on: August 19, 2013, 09:48:32 AM »
Hi Bruce,

I have a static html page I need to display.  It is longer than will fit on the standard size form or page in my app.  Thus, I need it to scroll vertically.

I have tried embedding it as xhtml on a page and on a form and in both of those the html text overflows way past the content height.

Interestingly, the form works well when I call it as a popup - except the form is a skinny little thing with a height of about 2500 pixels.  This approach might work for me when I am able to call a popup from the top level of a double drop menu.

So, does NT have a scrollable control that would let me display this text in a NT form.  Or, is there some other way to accomplish this.

Thanks 
Alan Schoolcraft

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11297
    • View Profile
Re: How to display static html page
« Reply #1 on: August 19, 2013, 08:53:13 PM »
Hi Alan,

First a little bit of terminology.

A "page" is an HTML container. In other words it contains a basic structure along the lines of

<html>
  <head>
  ...
  </head>
  <body>
  ...
  </body>
</html>


A page _is_ the basic container of a web site. So in that sense you cannot (*) "embed" one page in another.
(*) it is possible to embed one page in another using an iFrame, but I don't think that's what you're trying to do here.

Embedding _html_ inside a form, or page, is easy to do. Since it's just the HTML, and not the container itself. Forms have a "Display" field type, and you can use a tag like

<!-- Net:f:somefilename.htm -->

To include _html_ (not a page itself, but an html snippet) inside a NetWebForm or NetWebPage.

If you do have a static html file, and let's say it's a complete page, and let's say it's called whatever.htm,
then you can link to it in your program just by using the appropriate URL. eg
http://127.0.0.1:88/whatever.htm

now onto some questions;
When you say "I have a static html page I need to display." - do you mean display it by itself, or display it on a form etc?
and is it really a "page" or just an html "snippet"?

cheers
Bruce


alan

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • Email
Re: How to display static html page
« Reply #2 on: August 20, 2013, 03:23:09 AM »
Bruce,

I figured out how to handle my issue but I'll layout the solution here in case someone else wants to do the same thing.

On my NetWebForm for ordering my product, I wanted to let the user read some information if they had any last minute questions as they were ordering.  But, I didn't want to navigate them away from the order form and then hope they found their way back (without losing the info they had entered).

I created a fairly lengthy html document with hyperlinks, etc., providing information about the products.  That's the document I wanted to popup.

On the order form, I added a button to call a NetWebForm as a popup.
I then created the popup NetWebForm with no controls other than a Cancel button (In an embed I changed its text to "Close").  I then place my lengthy html document in the xhtml tab on the popup form.

Finally, to keep the popup form from expanding to a height of 2500px or more, I used CSS to set the height of the _frm div to 600px.

So now I have a popup form that displays a lengthy html document in a scrollable window.

(I'll probably take that html text and save it to disk and then include it into my popup using <!-- Net:f: just to make maintenance easier.)

THE ONLY REMAINING QUESTION I HAVE.....  The popup displaying the html opens scrolled all the way to the bottom.  Any suggestion on how I can get it to open without being scrolled all the way down?

Thanks
Alan Schoolcraft

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11297
    • View Profile
Re: How to display static html page
« Reply #3 on: August 20, 2013, 03:37:03 AM »
Hi Alan,

couple of small details;

>> I then created the popup NetWebForm with no controls other than a Cancel button (In an embed I changed its text to "Close").

Calling the form in "view" mode instead of "change" mode would have automatically provided a close, rather than cancel button. But your way will work fine too.

>> The popup displaying the html opens scrolled all the way to the bottom.  Any suggestion on how I can get it to open without being scrolled all the way down?

It scrolls to make the first control (capable of focus) visible. In this case this is the Close button, at the bottom. I would need to play around a bit to suppress that behavior.

cheers
Bruce