Jump to content
Sign in to follow this  
BruceR

Zero Plugin Web Viewer Interaction

Recommended Posts

I have created a zero-plugin Web Viewer interaction example.

It illustrates an interesting technique, but also illustrates what appears to be some text encoding problems that are encountered when using the data URL with web viewer. I have submitted this as a bug report but I welcome comments.

See example file here:

http://www.concise-design.com/downloads/simplewebtrigger.zip

The "holy grail" of the FileMaker Web Viewer is interaction between the web viewer and the FileMaker application. There are plugins that can accomplish this.

This file demonstrates a technique that provides limited interaction but does not require a plugin.

This can be done with script-triggering plugins or with the script triggering features of FileMaker 10.

Basic operation:

When the user clicks or tabs into a web viewer, an objectEnter script trigger starts a timer script. The timer script looks for certain data in the URL (layout object source) of the web viewer.

If the web viewer points to a simple external HTML file, then when a "method=get" type of form is submitted, the form parameters appear in the URL, like this:

file:///Users/bruce/Documents/fmaction.html?firstname=Bruce&lastname=Robertson

The timer script can look for the parameters, capture them, act on them, and reset the form.

Javascript in the form can put the focus back on the form field when the script selects the web viewer.

Try this in layout SimpleWebTrigger FM10. Only the last name field is evaluated, try putting in values like "a" or "w" or "roc". The portal should show matching values.

PROBLEM:

If you use the export CONTAINER button to generate the external html file, everything works correctly and you get a URL as shown above. However, if you use the export TEXTFIELD button, there is a problem and the result of any form submission gets truncated, see below:

file:///Users/bruce/Documents/fmaction.html?f=&l=r

This appears to be a character encoding problem and you can use a text editor such as BBEdit, TextWrangler, etc to correct the encoding of the file. Form submissions will then work correctly.

Now if you go to layout SimpleWebTrigger FM10 DataURL, you will see that it always fails, because of the truncated URL.

So it is my suspicion that there is an encoding problem that crops up when you use the data URL method with the web viewer and attempting to create interactive applications. This file demonstrates just one of the ways this problem crops up. I have encountered many instances of this problem when trying to build interactive web viewer applications.

Comments welcome.

--

Bruce Robertson

Concise Design

FileMaker 9 Certified

Edited by Guest

Share this post


Link to post
Share on other sites

When you export text field contents, the encoding is always UTF-16. I haven't examined this very closely, but I suspect that since your HTML document does not declare its encoding, the browser tries to guess - and doesn't guess correctly.

Share this post


Link to post
Share on other sites

When you export text field contents, the encoding is always UTF-16. I haven't examined this very closely, but I suspect that since your HTML document does not declare its encoding, the browser tries to guess - and doesn't guess correctly.

That's not the point.

We know that doesn't work.

The point is, that the data URL method doesn't work, and it appears to be for the same reason.

All my attempts to declare encoding make no difference.

Share this post


Link to post
Share on other sites

I don't see that the data URL method works at all, regardless of the encoding. I suspect it cannot work, because it cannot append a query to itself. But that's just off the top of my head, I would have to spend more time on this to understand it better.

Share this post


Link to post
Share on other sites

When you export text field contents, the encoding is always UTF-16. I haven't examined this very closely, but I suspect that since your HTML document does not declare its encoding, the browser tries to guess - and doesn't guess correctly.

Just did some further tests, having the file open using TextWrangler so I can declare encoding. The only thing that ever works is utf-8. You can set the file to be utf-16 and include this line:

But it will NOT work. Web viewer apparently ONLY accepts utf-8.

As far as my intent for this thread, I have two things in mind:

1. Show a no-plugin web viewer interaction technique

2. Explore why this does NOT work with a data URL method.

Share this post


Link to post
Share on other sites

OK, it works now! The trick is that the form tag must include this:

accept-charset="utf-8"

simplewebtrigger.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.