Alaska Software Inc. - HTA question
Username: Password:
AuthorTopic: HTA question
Bruce AndersonHTA question
on Sun, 17 Apr 2005 15:57:04 -0500
I put "go back" button on various screens of my WAA app.  The code is 
simple:
            oHtml:put([<a href="#" onClick="javascript:history.back();"><img 
src="/images/btn_back.gif" border=0 width=76 height=20></a>])
This works fine when the website is accessed by IE.  I made an HTML 
Application HTA file to access the website, and the "go back" button does 
not function.  I have looked through the literature and I still don't know 
why.  Maybe this is impossible; perhaps HTA's don't have any "history" on 
the workstation.  Is there a way to "go back" in an HTA?

Bruce Anderson
Houston, Texas
Phil Ide
Re: HTA question
on Mon, 18 Apr 2005 12:02:17 +0100
Bruce,

> I put "go back" button on various screens of my WAA app.  The code is 
> simple:
>             oHtml:put([<a href="#" onClick="javascript:history.back();"><img 
> src="/images/btn_back.gif" border=0 width=76 height=20></a>])
> This works fine when the website is accessed by IE.  I made an HTML 
> Application HTA file to access the website, and the "go back" button does 
> not function.  I have looked through the literature and I still don't know 
> why.  Maybe this is impossible; perhaps HTA's don't have any "history" on 
> the workstation.  Is there a way to "go back" in an HTA?

If the current page is an HTA, then there is no history.

Solution:
Have the HTA link to 'ordinary' html pages, which allows you to build a
history.  Provided you set <application navigable=yes> then you can link to
other pages.

Each time you load a .hta, or where there is an <application> tage, the
history is reset (it is effectively a new application).

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

On a clear desk you can never find anything.
Bruce AndersonRe: HTA question
on Mon, 18 Apr 2005 09:14:11 -0500
Thank you for confirming my suspicion.  After the initial login screen, 
every subsequent screen comes from WAA, hence there aren't any "ordinary 
html pages". I need to think of a way to store the previous page's input 
parameters so I can fake a history call.  If I do this right, I can probably 
make this app unworkable for a week while I try to unravel the damage.
Phil Ide
Re: HTA question
on Tue, 19 Apr 2005 10:13:18 +0100
Bruce,

> Thank you for confirming my suspicion.  After the initial login screen, 
> every subsequent screen comes from WAA, hence there aren't any "ordinary 
> html pages". I need to think of a way to store the previous page's input 
> parameters so I can fake a history call.  If I do this right, I can probably 
> make this app unworkable for a week while I try to unravel the damage.

All the pages coming from WAA are normal HTML pages, provided they don't
include an <application> tag in the header, or if the tag looks like this:

  <APPLICATION application=no navigable=yes>

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

The dead outnumber the living more than 30 to 1.
Bruce AndersonRe: HTA question
on Tue, 19 Apr 2005 09:38:15 -0500
OK, I am properly confused.
Below is the contents of my .hta file.  Is there something in it that 
prevents this from working?
<a href="#" onClick="javascript:history.back();"><img 
src="/images/btn_back.gif" border=0 width=76 height=20></a>

<html>
<head>
        <HTA:APPLICATION
        border="thin"
        borderStyle="sunken"
        caption="yes"
        maximizeButton="yes"
        minimizeButton="yes"
        showInTaskbar="yes"
        windowState="maximize"
        innerBorder="yes"
        application="yes"
        navigable="yes"
        scroll="auto"
        scrollFlat="no" />
        <title>My Application</title>
</head>
<frameset cols="*">
  <frame name="solo" target="_self" src="http://www.mysite.com/index.htm">
</frameset>
</html>

Index.htm submits a form containing login vars and WAA takes it from there. 
Every page after that is coming from WAA and I am not consciously putting an 
<application> tag in the page header.  I guess I am missing the obvious.
Phil Ide
Re: HTA question
on Tue, 19 Apr 2005 16:37:46 +0100
Bruce,

> Index.htm submits a form containing login vars and WAA takes it from there. 
> Every page after that is coming from WAA and I am not consciously putting an 
> <application> tag in the page header.  I guess I am missing the obvious.

Aaahh.  I suspect that you are a victim of some subtlety.

  onClick="javascript:history.back();"

I belive this applies to the window and not to the frame.  The window has
no history, but the frame does. Frame is also a window, but I'm not sure
whether "history" refers to the current frame or not.  Try this:

  document.parentWindow.history.back()

Regards,

Phil Ide

***************************************
* Xbase++ FAQ, Libraries and Sources: *
* goto: http://www.idep.org.uk/xbase  *
***************************************

Mama get the hammer, there's a fly on papa's head
Bruce AndersonRe: HTA question
on Thu, 21 Apr 2005 05:27:32 -0500