Hello.
I’m fiddling with a WebControlWrapper built so I can retrieve the content of php script from an external site. The resulting text of such script is something like:
It is a fingerprint template, to be processed in a time and attendance web app.
I would prefer getting the result of the script (which activates a fingerprint reader on the user machine), simulated here, with a simpler HTTPSocket. Unfortunately it does not work with the fingerprint reading php script, although it does work wth the simulation above.
I also tried with WebHTMLViewer and could get it to work, setting its URL property as the php (or the simulation) address. I couldn’t find a way to get the system to “read” the contents of the WebHTMLViewer and out it into a string variable.
Following old discussions on the forum around the subject, like this one, I found some techniques using WebControlWrapper.
I can make the WebControlWrapper read the information needed but it fails to access the DOM thorugh Javascript and fetch data. I know for sure the data is there. It shows on the ‘Developer Tools’ on Chrome…
Sample project is here.
This is what I have on a button to start fetching data after the WebControlWrapper has finished receiving data:
If ControlAvailableInBrowser() Then
ExecuteJavaScript(ReplaceAll(TakeFIR, "<<ControlID>>", Self.ControlID))
End If
This is the constant ‘TakeFIR’:
Xojo.triggerServerEvent('<<ControlID>>','HASFIR',document.getElementById("<<ControlID>>").document.innerHTML);
And this is the ExecuteEvent event:
If Parameters.Ubound = -1 Then
MsgBox("empty string")
Else
Select Case Name
Case "HASFIR"
Dim s As String = NthField(Parameters(0), ",", 2)
RaiseEvent HASFIR(s)
End Select
End If
Any ideas on why it does not work? Any way to make it work?