BrowserFrame vs Label when it comes to URI Fragments

I recently started creating my first Vaadin application, and it includes a file browser so users can look through different corporate reports generated by another tool. The solution involves a tree on the left and a panel on the right displaying the file selected in the tree. HTML files, when clicked, get their contents displayed in a Label component on the right. So far, so good.

These files have links to other files, referenced by relative urls. To allow users to “drill down” into these report structures, I created a temp file where I rewrote the urls, pointing back to my application with a URI Fragment on the end used to locate the new file. This worked well, and development progressed.

Then I found that img src elements were not being displayed correctly. I rewrote those elements as well, copying their files on demand to a common area under my application. Again, things worked well, and development progressed.

Then I found that urls pointing to internal names … other stuff … <a name="foo> absolutely did not work at all in Label components, but a simple test showed that they worked just fine in the BrowserFrame component (using FileResource).

However, all my url rewriting, adding uri fragments,does not work. Links clicked in the BrowserFrame component never made it back to my UriFragmentChangedListener (worked well with Label).


Is there a way to communicate back to the application on an url click this way from a BrowserFrame?
Is the problem due to BrowserFrame being opened in an iframe? Is there another way to do this without using javascript in the file? (I would be lost if that were the case)

That is the main question. Following is just information on the urls as they get rewritten:
A link in the file, unaltered, looks like:

My application is at pkrouse-e6410:8080/FileBrowser/app. Using the Label component and rewriting the url, this link (when floating the mouse over it) says:
pkrouse-e6410:8080/FileBrowser/app#html/tf_default.html
You can see the uri fragment on the end, and clicking this link works.
The same link in the same file, displayed in the BrowserFrame, looks the same when floating the mouse over it:
pkrouse-e6410:8080/FileBrowser/app#html/tf_default.html

However, clicking this link will bring up the whole application again in the browserframe, and my fragmentchangedlinstener never fired.

If I do not rewrite the urls and look at that same link in the browserframe, the url looks like this:
pkrouse-e6410:8080/FileBrowser/app/APP/connector/1/197/source/html/tf_default.html
But clicking that link does nothing at all.

This thread continues over at
https://vaadin.com/forum#!/thread/4315428