Difference between revisions of "Webview"

From Lianjapedia
Jump to: navigation, search
(Methods)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
Note: property, method and event names should be referred to in lowercase in case-sensitive scripting languages.
 
Note: property, method and event names should be referred to in lowercase in case-sensitive scripting languages.
 +
 +
====Description====
 +
Shown below in a standalone [[Form]].  Click the image to see in a [[Custom_Sections_and_Gadgets|Custom Section]] in a Lianja [[Page Attributes|Page]].
 +
 +
[[{{ns:file}}:webview.png|link={{filepath:webview_cs.png}}|Webview]]
 +
 +
Webview is an embedded WebKit control.
  
 
====Properties====
 
====Properties====
Line 5: Line 12:
 
This class supports the [[:Category:Common_Properties|Common Properties]] plus the following:
 
This class supports the [[:Category:Common_Properties|Common Properties]] plus the following:
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
 
!width="20%"|Property
 
!width="20%"|Property
 
!Access (R/RW)
 
!Access (R/RW)
Line 11: Line 18:
 
!width="50%"|Description
 
!width="50%"|Description
 
|-
 
|-
|Html||R||Character||HTML text to be rendered
+
|Html||W||Character||HTML text to be rendered
 
|-
 
|-
|Url||RW||Character||URL to be rendered
+
|Password||RW||Character||Password for URL
 
|-
 
|-
 
|RefreshInterval||RW||Numeric||Interval in seconds that the content will be refreshed
 
|RefreshInterval||RW||Numeric||Interval in seconds that the content will be refreshed
 +
|-
 +
|Url||RW||Character||URL to be rendered
 
|-
 
|-
 
|Username||RW||Character||Username for URL
 
|Username||RW||Character||Username for URL
|-
 
|Password||RW||Character||Password for URL
 
 
|-
 
|-
 
|}
 
|}
Line 27: Line 34:
 
This class supports the [[:Category:Common_Methods|Common Methods]] plus the following:
 
This class supports the [[:Category:Common_Methods|Common Methods]] plus the following:
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
 
!width="20%"|Method
 
!width="20%"|Method
 
!Args
 
!Args
Line 33: Line 40:
 
|-
 
|-
 
|Back||None||Go back one page
 
|Back||None||Go back one page
 +
|-
 +
|Clear||None||Clear page
 +
|-
 +
|valign=top|Evaluate||valign=top|text as Character||Evaluates the JavaScript in text and returns the result of the last executed statement
 
|-
 
|-
 
|Forward||None||Go forward one page
 
|Forward||None||Go forward one page
 
|-
 
|-
|Reload||None||Reload current page
+
|valign="top"|Load
 +
|valign="top"|filename as Character
 +
|valign="top"|Load an HTML formatted file into the WebView
 
|-
 
|-
|Stop||None||Stop loading page
+
|valign="top"|PreviewReport
 +
|valign="top"|options as Character<br>
 +
|valign="top"|Preview print for a [[Reports Workspace|Report Section]].  The options string can specify the orientation, outputformat and outputfilename, e.g.
 +
<pre>oRep = Lianja.get("printreport.section1")
 +
oWV = oRep.webview
 +
cOptions = 'orientation=landscape,';
 +
+ 'outputformat=pdf,';
 +
+ 'outputfilename=output.pdf'
 +
oWV.previewReport(cOptions)</pre>
 
|-
 
|-
|Print||None||Print page
+
|valign="top"|print
 +
|valign="top"|printername as Character, orientation as Character, format as Character, filename as Character, papersize as Character, numcopies as Numeric, geowidth as Numeric, geoheight as Numeric<br>
 +
|valign="top"|Print page.<br>
 +
printername -- get this using [[APRINTERS()]] or [[GETPRINTER()]]<br>
 +
orientation -- "Landscape" or "Portrait"<br>
 +
format      -- "Native", "PDF" or "PostScript"<br>
 +
filename    -- output filename if "PDF" format<br>
 +
papersize  -- any of the following as a string: A4, Legal, Letter, etc<br>
 +
numcopies  -- number of copies to print<br>
 +
geowidth    -- design time screen geometry width<br>
 +
geoheight  -- design time screen geometry height<br><br>
 +
Note: in JavaScript, the print() method should be used without arguments and will display the OS print dialog.
 
|-
 
|-
|valign=top|Evaluate||valign=top|text as Character||Evaluates the JavaScript in text and returns the result of the last executed statement
+
|valign="top"|printHtml
 +
|valign="top"|pdffilename as Character | printername as Character, papersize as Character, left as Numeric, right as Numeric, top as Numeric, bottom as Numeric, paperwidth as Numeric, Naperheight as numeric, units as Character<br>
 +
|valign="top"|Print webview.  From v7.1.<br>
 +
pdffilename -- name of output PDF file<br>
 +
printername -- get this using [[APRINTERS()]] or [[GETPRINTER()]]<br>
 +
papersize  -- any of the following as a string: A4, Legal, Letter, etc.<br>
 +
left        -- left print margin in pixels<br>
 +
right      -- right print margin in pixels<br>
 +
top    -- top print margin in pixels<br>
 +
bottom  -- bottom print margin in pixels<br>
 +
paperwidth    -- paper width in units<br>
 +
paperheight  -- paper height in units<br>
 +
units        -- papersize units for paperwidth and paperheight: "inch", "millimetre" or "point"<br>
 
|-
 
|-
|Write||text as Character||Output the specified text
+
|valign="top"|printPreview
 +
|valign="top"|pdffilename as Character | printername as Character, orientation as Character, format as Character, filename as Character, papersize as Character, numcopies as Numeric, geowidth as Numeric, geoheight as Numeric<br>
 +
|valign="top"|Preview print.<br>
 +
pdffilename -- pdf filename (no further parameters should be specified)<br>
 +
printername -- get this using [[APRINTERS()]] or [[GETPRINTER()]]<br>
 +
orientation -- "Landscape" or "Portrait"<br>
 +
format      -- "Native", "PDF" or "PostScript"<br>
 +
filename    -- output filename if "PDF" format<br>
 +
papersize  -- any of the following as a string: A4, Legal, Letter, etc<br>
 +
numcopies  -- number of copies to print<br>
 +
geowidth    -- design time screen geometry width<br>
 +
geoheight  -- design time screen geometry height
 
|-
 
|-
||WriteTag||tag as Character, text as Character||Output the specified text, tagged with the specified tag
+
|Reload||None||Reload current page
 
|-
 
|-
|Clear||None||Clear page
+
|valign="top"|saveAsPdf||pdffilename as Character||Save to the specified PDF.  From v9.3.
 
|-
 
|-
 +
|Stop||None||Stop loading page
 +
|-
 +
|Write||text as Character||Output the specified text.
 +
|-
 +
||WriteTag||tag as Character, text as Character||Output the specified text, tagged with the specified tag.
 +
|-
 +
 
|}
 
|}
  
Line 56: Line 118:
 
This class supports the [[:Category:Common_Events|Common Events]] plus the following:
 
This class supports the [[:Category:Common_Events|Common Events]] plus the following:
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
 
!width="20%"|Event
 
!width="20%"|Event
 
!Args
 
!Args

Latest revision as of 11:22, 27 September 2023

Note: property, method and event names should be referred to in lowercase in case-sensitive scripting languages.

Description

Shown below in a standalone Form. Click the image to see in a Custom Section in a Lianja Page.

Webview

Webview is an embedded WebKit control.

Properties

This class supports the Common Properties plus the following:

Property Access (R/RW) Value Description
Html W Character HTML text to be rendered
Password RW Character Password for URL
RefreshInterval RW Numeric Interval in seconds that the content will be refreshed
Url RW Character URL to be rendered
Username RW Character Username for URL

Methods

This class supports the Common Methods plus the following:

Method Args Description
Back None Go back one page
Clear None Clear page
Evaluate text as Character Evaluates the JavaScript in text and returns the result of the last executed statement
Forward None Go forward one page
Load filename as Character Load an HTML formatted file into the WebView
PreviewReport options as Character
Preview print for a Report Section. The options string can specify the orientation, outputformat and outputfilename, e.g.
oRep = Lianja.get("printreport.section1")
oWV = oRep.webview
cOptions = 'orientation=landscape,';
+ 'outputformat=pdf,';
+ 'outputfilename=output.pdf'
oWV.previewReport(cOptions)
print printername as Character, orientation as Character, format as Character, filename as Character, papersize as Character, numcopies as Numeric, geowidth as Numeric, geoheight as Numeric
Print page.

printername -- get this using APRINTERS() or GETPRINTER()
orientation -- "Landscape" or "Portrait"
format -- "Native", "PDF" or "PostScript"
filename -- output filename if "PDF" format
papersize -- any of the following as a string: A4, Legal, Letter, etc
numcopies -- number of copies to print
geowidth -- design time screen geometry width
geoheight -- design time screen geometry height

Note: in JavaScript, the print() method should be used without arguments and will display the OS print dialog.

printHtml pdffilename as Character | printername as Character, papersize as Character, left as Numeric, right as Numeric, top as Numeric, bottom as Numeric, paperwidth as Numeric, Naperheight as numeric, units as Character
Print webview. From v7.1.

pdffilename -- name of output PDF file
printername -- get this using APRINTERS() or GETPRINTER()
papersize -- any of the following as a string: A4, Legal, Letter, etc.
left -- left print margin in pixels
right -- right print margin in pixels
top -- top print margin in pixels
bottom -- bottom print margin in pixels
paperwidth -- paper width in units
paperheight -- paper height in units
units -- papersize units for paperwidth and paperheight: "inch", "millimetre" or "point"

printPreview pdffilename as Character | printername as Character, orientation as Character, format as Character, filename as Character, papersize as Character, numcopies as Numeric, geowidth as Numeric, geoheight as Numeric
Preview print.

pdffilename -- pdf filename (no further parameters should be specified)
printername -- get this using APRINTERS() or GETPRINTER()
orientation -- "Landscape" or "Portrait"
format -- "Native", "PDF" or "PostScript"
filename -- output filename if "PDF" format
papersize -- any of the following as a string: A4, Legal, Letter, etc
numcopies -- number of copies to print
geowidth -- design time screen geometry width
geoheight -- design time screen geometry height

Reload None Reload current page
saveAsPdf pdffilename as Character Save to the specified PDF. From v9.3.
Stop None Stop loading page
Write text as Character Output the specified text.
WriteTag tag as Character, text as Character Output the specified text, tagged with the specified tag.

Events

This class supports the Common Events plus the following:

Event Args Description
linkClicked link as Character Occurs after link is clicked (not called if showdocument link: 'app:', 'page:', 'section:', 'recital::', 'vfp:', 'python:', 'php:' or 'jscript:')