Help with HTML Viewer in Desktop App

I’ve just installed Xojo and created a desktop app. I am a VB programmer, primarily with experience with VB6, although I do use occasionally to create small business apps but have in no way mastered it.

To start out simply, my question is, how do I use xojo to manipulate the data in the HTML viewer? I want to take items out of the HTML viewer and either stick them in text boxes outside the viewer or perform calculations on them and then post the results back into certain fields in the viewer. I couldn’t see any obvious way to do this, so I’m struggling here.

  • You can stop reading there or here’s more detail about what I’m trying to accomplish:

What I am looking to do is to create a simple program for my wife - one probably desktop based and one for iOS. Basically, I’m trying to find a very simple answer to her need to take a 3rd party web order form and make it a bit smarter without having the ability to change the web form. This is for her job, not mine, so I’m trying to get this done quickly in my spare time. My experience is pretty much entirely with PCs and this needs to be implemented on a MacBook Pro, iPhones and iPads. I’m starting with a desktop version on the PC to try to understand Xojo better. I see that I’ll have to work on the Mac in order to build an iOS app.

The basic goal is very simple - the existing form (yes, the best long run answer is to find another solution for that form but that isn’t something I can control right now) doesn’t support sales tax. I need to make a button to take the fields from the web form for the order total and shipping amount, add those together, multiply them times the tax rate and fill in the sales tax field. I have other helpful things I can add to this for her later (local database for existing customers, etc.) but right now I have a very short time-line to come up with a finished product. I briefly pursued just making a local html file and using Javascript to accomplish this (I’m a javascript newbee too) but I was unaware of cross-site scripting restrictions so I hit a wall after I almost had the project finished.

Thanks for any help/advice you can provide.

you can run javascript and check things using MBS Plugin if you like. We have a couple of extensions there for HTMLViewer for Mac, Win and Linux.

The current workaround for getting info out of a htmlviewer is to use something similar to

myHTMLViewer.ExecuteJavaScript("window.status = MyJSThatReturnsAString();")

then, in the HTMLViewer StatusChanged event you handle the data. You very quickly run into problems with sync/async, and parsing, and other random nightmares. I know because I’ve spent the last week working on a neat control for RichText/HTML (coming soon!)

For completion time speed I would check out the MBS plugins for interacting with HTMLViewer. However, I think best solution is to write your own order handling app. @shao sean is the resident guru on HTMLViewer haxxies, and I can help a lot with JavaScript interactions. I don’t know what your current billing solution is, but if you’re willing to share that info we (the community) might be able to help a little bit more.

If you would like a complete custom solution, I’m also available for hire :stuck_out_tongue:

Also, side note, I don’t think you charge tax on shipping, as the shipping company does that.

Thanks - I’ll try to figure out how to install the MBS plugin and go from there. I agree that the best solution is my own order handling app, but as I said, this is for my wife’s company and I’m just trying to get this done as quickly as possible with a budget of virtually zero. They are transitioning from one webhost to another and I have no idea what kind of set up they have for mySQL or other databases. I don’t know what you meant by “current billing solution” - could you elaborate?

And, for my own side note, Washington State is evil when it comes to sales tax - the taxability of shipping follows the transaction here - if an item is taxable, then the shipping is taxable.

LOL. I almost posted “… unless you live in Washington state”, but that didn’t seem to add anything to the conversation, so I refrained. Washington has lost their minds.

You said [quote]3rd party web order form

the existing form (yes, the best long run answer is to find another solution for that form but that isn’t something I can control right now) doesn’t support sales tax.[/quote] so I assumed that was an existing billing solution that you’re trying to work with.