In my webview, I’ve defined a hyperlink field (“hyperlinks=id”)
lib:/report.rsp?database=sfm&table=documenti&heading=Documenti aperti&fields=keylookup("Clienti", "id", keylookup("Progetti", "id", documenti.progettoid, clienteid), cliente),keylookup("Progetti", "id", documenti.progettoid, progetto),id,caso,priorita,descrizione,stato&headings=Cliente,Progetto,N Documento,Caso,Priorita,Descrizione,Stato&hyperlinks=id&gridlines=false
then I’ve flagged my “delagate hiperlink” and in the “delagate script”
then I’ve write my function:
//////////////////////////////////////////////////////////////// // Event delegate for 'linkclicked' event proc Pagina_attivita_in_corso_Sezione_attivita_in_corso_linkclicked(arg) // insert your code here m_filtro = "page:documento.documento_documento?action=search&text=" + arg ? "m_filtro = " + m_filtro Lianja.showDocument(m_filtro) Lianja.showDocument("page:documento.documento_documento?action=show") endproc
when I click on my hyperlink, the args is empty..
In the rsp file (backup the file if you are using the default lib:/report.rsp and remember that it will be overwritten by the installer) change the lines:
if len(target) > 0 ?? ('&(space)' + m_link + '') else ?? ('lianja_relatedata:' + lower(alltrim(etos(&fld))) + '">&(space)' + m_link + '') endif
Can I use Lianja.evaluate to set a value on a canvas section from a webview
I would like to set a textbox on a canvas section with that variable value.
Using Linja.evaluate(“page.section.object”), I can get the current value of the textbox like so
var p = Lianja.evaluate('Lianja.get("page1.section1.txt1").value'); Lianja.showMessage(Lianja.evaluate(p));
However, I don’t seem to be able to set the value.
As this is desktop you can use Lianja.execute( )
Lianja.evaluate( ) is for evaluating expressions.
Lianja.execute( ) is for executing Lianja/VFP commands.
Note that the Lianja system object is system wide across all sections in an app so you can perform operations on any UI elements directly. You only need to reference them with Lianja.get( )
var myglobal = "abcd";
Custom library code runs in the client.
Passing client side data to server pages should be done as parameters that should preferably be base64 encoded and if passing many of them added to an object which is JSON encoded on the client and JSON decoded on the server.
If you are ever stuck in a webview section, right click it and use the inspector, it will let you know where your issue is.
If you are not sure how to use it, here is link that may be useful.
I’m tryng to create a HTML Editor server page.
I’ve created a page, with a WebView section, saved as a Server Page.
is possible to force the ControlSource of the webview section?
I’ve try with:
public Ps_ControlSource Ps_ControlSource = "articoli.abbinamenti" lianja.showdialog("EditorHTML", "EditorHTML") release Ps_ControlSource
then, in the Load of EditorHTML page:
section = lianja.get("section1") value = Ps_ControlSource section.ControlSource = value
but not work..
controlsource is a RW property of webview, but i I type:
a = lianja.get("EditArtCarTesto.section1") ? "-" + a.controlsource + "-"
I get: —
a = lianja.get("EditArtCarTesto.section1").webview
Remember that you can change the attributes of the section and also those of the UI element inside it so you need to reference the element contained within the section which is a container.
A Webview section in a desktop app is not connected to an http server.
Attempting to use a FileReader is only valid in a web browser client not a desktop app with an embedded Webview.
The desktop client has a web server running internally in port 8002
I’ve a difference from Webview and printed webview.
If I print with:
Webview.printpreview(GETPRINTER(), ‘PORTRAIT’, ‘NATIVE’, ”, ‘A4’, 1)
then print from the preview..
google this “a4 size in pixels” and experiment.
72 dpi (web) = 595 X 842 pixels
300 dpi (print) = 2480 X 3508 pixels (This is “A4” as I know it, i.e. “210mm X 297mm @ 300 dpi”)
600 dpi (print) = 4960 X 7016 pixels
Try generating as a “PDF” rather than “native”
also, you need to specify the output filename for the PDF file. Read the doc for WebView print()
Webview.print(GETPRINTER(), ‘PORTRAIT’, ‘PDF’, ‘c:\temp\schedaarticolo.pdf’, ‘A4’, 1)
In a desktop application, I have a web view section and a canvas section.
How can I reference an id in the webview section from the canvas section?
access to the webview objects from outside the webview.
Meaning – If I want to change the innerhtml of an item in the webview from a canvas section how can that be accomplished.
I guess another way to ask the same question is what is the hierarchy of webview in the LOM/DOM
something like Lianja.page1.document.getElementById(“Title”).inne rHTML = “New Title!”;
reference to the WebView section in Lianja.
myview = Lianja.getElementByID(“page1.section1”).webview