EPNG - TemplatePanel in FireFox

Has anyone tried EPNG - TemplatePanel in FireFox?

It renders just the text from the template (including the style declarations).
I tried it with FireFox 1 and 1.5.

All echo2 components work in FireFox and that is the browser I use to test my development. Does anyone know about any other browser that works perfectly with echo2 in Linux environment?

mjablonski's picture

syam+Jan 17 2006, 08:25 AM(syam @ Jan 17 2006, 08:25 AM)

Quote:
Has anyone tried EPNG - TemplatePanel in FireFox?

It renders just the text from the template (including the style declarations).
I tried it with FireFox 1 and 1.5.

All echo2 components work in FireFox and that is the browser I use to test my development. Does anyone know about any other browser that works perfectly with echo2 in Linux environment?

[snapback]5945[/snapback]

Please wrap your XHTML for the TemplatePanel in a <div>-tag which declares the correct namespace (needed for Firefox):

<div xmlns="http://www.w3.org/1999/xhtml">
your XHTML goes here
</div>

For a longer discussion of this problem see:

[url=http://forum.nextapp.com/forum]http://forum.nextapp.com/forum]

HTH, Maik

Thanks for the help! It is working now.

Also, I have completely forgotten to investigate the Konqueror under Linux. My Konqueror was not working with echo2 because I had changed the browser identifier to "IE" as a workaround to run another application on my localhost!! I changed it back to normal and my echo2 application is running there too.

bbakerman's picture

This is now fixed in the lastest CVS update.

bbakerman+Jan 19 2006, 12:41 AM(bbakerman @ Jan 19 2006, 12:41 AM)

Quote:
This is now fixed in the lastest CVS update.
[snapback]5966[/snapback]


Brad,

I checked out today's CVS of EPNG (using with Echo 2.0.1.test1), and I still got this problem, using Firefox 1.5.0.1.

bbakerman's picture

This is taken from the current CVS source in the rendering peer.

compiledTemplate.markupE.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");

I am pretty sure I updates this a while ago. Its working for me on FireFox 1.5.0 on Windows. If you add the xmlns atribute to you template data source does it work?

That line is also in my TemplatePanelPeer.java, so I assume I have the correct version.

If I use:

TemplatePanel tp = new TemplatePanel();
tp.setTemplateDataSource(new StringTemplateDataSource("<b>test</b>"));

the markup is not rendered in Firefox, but if I add a DIV with the xmlns attribute around it, it works well.

I tested this with Firefox 1.5.0.1 on Window and Firefox 1.0 on Solaris, and observed the same behaviour.

bbakerman's picture

I cant really see what is happening here unless its a FireFox 1.5.0.1 issue.

In fact I can find a reference to a version of FireFox as 1.5.0.1 only 1.5 or 1.6a nightly build.

I am using FireFox 1.5 on windows and it works for me. I wrote this code

	public Component testNameSpace() {
  TemplatePanel tp = new TemplatePanel();
  tp.setTemplateDataSource(new StringTemplateDataSource("<b>bold and <u>underlined</u> and <i>italic</i> all inside bold text</b>"));
  return tp;
	}

See the screen shot for this example working on FireFox 1.5 on Windows

sarath's picture

TemplatePanel is not working in FireFox but works fine in IE.

syam wrote:

Has anyone tried EPNG - TemplatePanel in FireFox?

It renders just the text from the template (including the style declarations).
I tried it with FireFox 1 and 1.5.

All echo2 components work in FireFox and that is the browser I use to test my development. Does anyone know about any other browser that works perfectly with echo2 in Linux environment?

Here is a java-based solution!

Yes, it is still buggy. And now we are toward the end of 2009...
The workaround suggested by mjablonski works fine (putting the namespace on a div, or even on the root <html> tag) but no java-based solution has been suggested yet.

The line
compiledTemplate.markupE.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
(see the post by bbakerman) is already in the code but is not enough.

So here is my java-based solution:
in XHTMLTemplateCompiler.java substitute
factory.setNamespaceAware(true);
with
factory.setNamespaceAware(false);

That's all! Just one line and it works with Firefox too (tested with v3.0.14).