Request : StatusChanged or TitleChanged for iOSHTMLViewer

I am in the process of porting Check Print’R to iOS/iPad. Thanks to Jean-Paul Devulder’s dtPlugins for iOS, I can print to Airprint, without which the app could not exist.

Now I am starting work on the Register, which like a paper records book requires rows, columns, checkboxes and editable cells (see the macOS one below).

Instead of going through hell with iOSTable, I think I can come up with a pretty good grid with HTML.

Thanks to Jason King, we already have these for iOSHTMLViewer :

  • DocumentBegin
  • DocumentComplete
  • CancelLoad
  • Error
  • ExecuteJavaScript

https://forum.xojo.com/conversation/post/154521 and https://forum.xojo.com/19271-ios-what-we-want-roadmap/20

The only piece missing to enable a real cool grid control is StatusChanged or TitleChanged, in order to send back data to the application. When I have that, not only will I be able to complete my project, I will make it available.

If any declare guru would bring this into existence, I will be eternally grateful.

How about requesting a real way to send data back, instead of requesting a hacky way. The only reason we use StatusChanged on Desktop is because Xojo don’t seem to agree with us on the priority of the function.

I have now simply given up on Xojo’s willingness to implement sorely needed methods, properties and events to iOS controls. I filed dozens of feature requests back in late 2014 and 2015 for very basic things that simply went to oblivion.

Since we are basically on our own when it comes to the most basic features, we might as well count only on the community.

evaluateJavaScript(_:completionHandler:) would be wonderful indeed.

For the moment, I could probably figure some real hackish way using the CancelLoad event Jason provided. For instance navigate to a return://one.two.three.four location, which the app would return True, and then parse on dot to get the four parameters. And if the content contains dots, use some replace on both ends.

There are no properties for Title or Status ?

I am not terribly bright. Jason’s ExecuteJavaScript is in fact EvaluateJavaScript underneath, and it returns values sent to it from JS.

That should be sufficient for what I want to do.

[quote=288643:@Michel Bujardet]

There are no properties for Title or Status ?[/quote]

There is not.

There’s not any other way to do it. Anytime you want the state of the rendered page you have to cross the javascript bridge. A web view is a LOT like a XojoScript. You have a limited context for moving data back/forth.

[quote=288645:@Michel Bujardet]Jason’s ExecuteJavaScript is in fact EvaluateJavaScript underneath, and it returns values sent to it from JS.

That should be sufficient for what I want to do.[/quote]
Glad you found it - I was going to suggest you try this since it should do exactly what you need.

Thank you again, Jason :slight_smile:

You might have misinterpreted what I meant. I was suggesting requesting a real function to return the value of a JavaScript, and not requesting for a roundabout way to do a similar thing. In fact, the feature is available in UIWebView.
stringByEvaluatingJavaScriptFromString:
Also there is a desktop equivalent.

It looks like Jason King has already made the declare available to iOS.

The declare exists also for Mac in an MBS plugin.

However, EvaluateJavaScript has a disadvantage : initiative must come from Xojo. That is fine and well in many cases, but what if, as I plan to do, you initiate an action from JavaScript ?

With CancelLoad (as the other are not here), I plan to send from JavaScript back to Xojo, actions that were initiated in the web page (edition, suppression, contextual menu, etc.).

With EvaluateJavaScript, you would have to poll regularly some JavaScript method.

So each has its advantages.

[quote=288711:@Tim Parnell]You might have misinterpreted what I meant. I was suggesting requesting a real function to return the value of a JavaScript, and not requesting for a roundabout way to do a similar thing. In fact, the feature is available in UIWebView.
stringByEvaluatingJavaScriptFromString:
Also there is a desktop equivalent.

It looks like Jason King has already made the declare available to iOS.[/quote]

Ah yes I misread you. I’ve been working on iOS apps since they launched and used the same kind of declare. I thought you meant you wanted something more advanced then string passing.