Error processing SSI file
Error processing SSI file

Home » Development Area » DigiGuide Listings Grabber » API Index » Class: HTMLWindow

Class: HTMLWindow


Summary

Provides the ability for scripts to have a user interface.


Methods

MethodDescription
 close Close the window.
 show Shows the HTMLWindow


Events

EventDescription
 onFormSubmit Called when a form has been submitted.


Properties

PropertyDescription
 caption Caption you want to use for the window.
 html HTML you wish to show within the window. It's not complete HTML, no javascript support.


Examples

Code below shows a simple form being used. Note that one of the form items is duplicated and this results in an array being used in the form callback.

//enableDebug( true );
var g = new Grabber( "Grabber Test HTML UI", "GBR" );

g.onShowUI = function( lp )
{
var hwin = new HTMLWindow;
hwin.m_grabber = this;
var strHTML = "<p><form method=post action='savename' >" +
"What name would you like to use for this grabber: <input type='text' size='20' name='name'><input type='hidden' name='bleh' value='blah blah'><input type='hidden' name='bleh' value='2 2'>" +
"<p align=right><input type='submit' value=' OK '>   <input type='submit' value='Cancel'></p>" +
"<table>" +
"<tr><td>hello</td></tr>" +
"<tr><td>hello</td></tr>" +
"<tr><td>hello</td></tr>" +
"<tr><td>hello</td></tr>" +
"<tr><td>hello</td></tr>" +
"<tr><td>hello</td></tr>" +
"<tr><td>hello</td></tr>" +
"<tr><td>hello</td></tr>" +
"<tr><td>hello</td></tr>" +
"<tr><td>hello</td></tr>" +
"<tr><td>hello</td></tr>" +
"</table>" +
"</form>";

hwin.html = strHTML;
hwin.caption = "Test HTML Window";


hwin.onFormSubmit = function( formName, form )
{
if( typeof form.bleh == "object" )
{
this.m_grabber.setOption( "items", form.bleh.length );
for( var n = 0; n < form.bleh.length; n++ )
{
this.m_grabber.setOption( "item" + n, form.bleh[ n ] );
}
}

if( form.submit == " OK " )
{
this.grabberName = form.name;
this.close( true );
}
else
{
this.close( false );
}
}

if( hwin.show() )
{
this.grabberSaveName = hwin.grabberName;
}

return true;
}


g.onRun = function( lp )
{
lp.writeLog( "running..." );

for( var n = 0; n < this.getOption( "items"); n++ )
{
alert( this.getOption( "item" + n ) );
}

return true;
}


Requirements

Build Build 3

(Last updated: February 13, 2020 12:43:30)

Error processing SSI file