Foros de discusión

Firefox Issues

thumbnail
Tom Cat, modificado hace 12 años.

Firefox Issues

Junior Member Mensajes: 34 Fecha de incorporación: 14/07/11 Mensajes recientes
Hello,

I'm having issues when using firefox 3.0, 3.6, 5.0 & 6.0 when using my self written portlet.
Layout seems to be quite different and certain functions don't work. IE works still fine.
Do I have to set firefox parameters or smth.?

Tom Cat
thumbnail
Leo Pratlong, modificado hace 12 años.

RE: Firefox Issues

Expert Mensajes: 363 Fecha de incorporación: 6/07/10 Mensajes recientes
This is normal : IE does not follow web standards. And firefox is not at 100% on W3C validation test either. And even if you use browsers which are compliant with W3C rules (WebKit, so Chrome and Safari for example), it should still be some differents.

So, you'll never have the same display from a browser to an other (CSS and Javascript). What you have to do is to test your web-applications on all the current browsers (Chrome, Safari, Firefox, IE, Opera) for each version which have a large range of users. You can use specific styling for each browser (or just use CSS hacks to make it work faster).

Good luck, that's the worst job on web development emoticon.
thumbnail
Hitoshi Ozawa, modificado hace 12 años.

RE: Firefox Issues

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
You can use specific styling for each browser (or just use CSS hacks to make it work faster).


There's some differences between browser version too. So, it's may also be necessary to add specific styling for each browser versions too.
thumbnail
Tom Cat, modificado hace 12 años.

RE: Firefox Issues

Junior Member Mensajes: 34 Fecha de incorporación: 14/07/11 Mensajes recientes
Hello,

first of all thanks for the kind and fast answers. So in fact it possible that certain elements like <aui> buttons etc.
are different in firefox and IE and i have to implement .css to fix that?

Tom Cat
thumbnail
Leo Pratlong, modificado hace 12 años.

RE: Firefox Issues

Expert Mensajes: 363 Fecha de incorporación: 6/07/10 Mensajes recientes
Tom Cat:
Hello,

first of all thanks for the kind and fast answers. So in fact it possible that certain elements like <aui> buttons etc.
are different in firefox and IE and i have to implement .css to fix that?

Tom Cat


<aui> component you use in your jsp is a taglib. This means that this is a server side component which will generate HTML/css/js (so, browser-understandable code) for the client-side.
I think (I can not ensure it) that <aui> components are built to work on the most used browsers. But, what can affect the display is the style you use to customize your page.
But, with Liferay, it can be easy to fix some behaviour on a specific browser: liferay adds CSS class which indicates your OS, your browser etc. on the HTML node. For example, on a web portal I have done with Liferay 6.0.6, HTML node has this classes:
ltr yui3-js-enabled gecko firefox firefox5 mac ltr js


So, by defining, for example:
.firefox5 table {}
.firefox5 ul {}

you'll be able to describe your correct behaviour for this platform.
thumbnail
Tom Cat, modificado hace 12 años.

RE: Firefox Issues

Junior Member Mensajes: 34 Fecha de incorporación: 14/07/11 Mensajes recientes
It is kind of strange because i made 3 portlets, all are using the same imports same html and just one is working
properly. I don't mind about layout atm. but the functions which are bound to the gui elements won't work on
the other 2 portlets
thumbnail
Leo Pratlong, modificado hace 12 años.

RE: Firefox Issues

Expert Mensajes: 363 Fecha de incorporación: 6/07/10 Mensajes recientes
When you say "functions", you mean "Javascript functions" ? This is normal since Javascript engines are different from a browser to an other. Most of time, it's with IE there are the most of problems (especially with JS). But, since you designed your portlet under IE, you now find the bugs on firefox. That's logical: but it means you have adapted your development to work on IE. Maybe it would be better to develop on firefox (or Chrome) then to try to fix it for IE.

You can "easily" track your bugs on Firefox with Firebug.
With WebKit (Chrome, Safari...), you have a development tool embeeded.
And under IE, there are also some development tools (JS debugger from MicroSoft, I do not remember the name, ...).
thumbnail
Tom Cat, modificado hace 12 años.

RE: Firefox Issues

Junior Member Mensajes: 34 Fecha de incorporación: 14/07/11 Mensajes recientes
For example if I click on my button this code works in IE but not in Firefox

<aui:button type="submit" name="testing" value="Dienste aktivieren/deaktivieren" onclick="document.getElementById('action').value = 'mbeans';"/>

i deleted all the js code from my portlet (no change)
thumbnail
Leo Pratlong, modificado hace 12 años.

RE: Firefox Issues

Expert Mensajes: 363 Fecha de incorporación: 6/07/10 Mensajes recientes
In Firebug (donwload it and install it if you don't have), what's the error?

document.getElementById('action') is OK. No problem with that. If it is an input, the ".value" is OK too. Are you sure your error is relative to that?


Edit:
If you are using this exactly on all 3 portlets
document.getElementById('action').value

and all 3 portlets are on the same page, that means you have an 3 elements with id="action" which is not valid HTML. ID must be unique among all html elements. In order to fix this you can just add the portlet namespace in front of it using the portlet namespace taglib:

<portlet:namespace />


Wowww, you're right. I forgot this fact!
thumbnail
Amos Fong, modificado hace 12 años.

RE: Firefox Issues

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
If you are using this exactly on all 3 portlets
document.getElementById('action').value

and all 3 portlets are on the same page, that means you have an 3 elements with id="action" which is not valid HTML. ID must be unique among all html elements. In order to fix this you can just add the portlet namespace in front of it using the portlet namespace taglib:

<portlet:namespace />
thumbnail
Tom Cat, modificado hace 12 años.

RE: Firefox Issues

Junior Member Mensajes: 34 Fecha de incorporación: 14/07/11 Mensajes recientes
Won't work : /

I'll try a workaround and get myself a stable release and come back to this thread later.

Thanks for all the help.
thumbnail
Tom Cat, modificado hace 12 años.

RE: Firefox Issues

Junior Member Mensajes: 34 Fecha de incorporación: 14/07/11 Mensajes recientes
2 cnd portlet works now ( to much hidden fields emoticon )
Working on the 3rd one
thumbnail
Tom Cat, modificado hace 12 años.

RE: Firefox Issues

Junior Member Mensajes: 34 Fecha de incorporación: 14/07/11 Mensajes recientes
Hello,

in my 3rd portlet i have just 3 jsps which contain HTML Code which works fine for IE but not for Firefox:

First JSP (Index JSP)



<title>DomainManager</title>



<portlet:renderurl var="actionURL">
	<portlet:param name="jspPage" value="/html/gwdomainmanager/view.jsp" />
</portlet:renderurl>

<form action="<%= actionURL %>" method="post">
<input type="hidden" name="action" value="">

<center>
&lt;%= Combobox %&gt;

<br>
<br>

<table>
<tbody><tr>
<td><input type="Submit" name="submit1" value="Neue Domäne" onclick="document.getElementById('action').value = 'server';"></td>
<td><input type="Submit" name="submit2" value="Domäne löschen" onclick="document.getElementById('action').value = 'del';"></td>
</tr>
</tbody></table>
</center>
</form>



My 2nd jsp (new jsp)



<title>DomainManager</title>



	<portlet:renderurl var="actionURL">
		<portlet:param name="jspPage" value="/html/gwdomainmanager/new.jsp" />
	</portlet:renderurl>

	<h2>Domain Hinzufügen</h2>
	<form action="<%=actionURL%>" method="post">
		<table>
			<tbody><tr>
				<td style="width: 200px;">Domainname</td>
				<td style="width: 300px;"><input type="text" name="domainname" value="" style="width:300px;">
				</td>
			</tr>
		</tbody></table>
		<br>
		<table border="2" cellspacing="2" cellpadding="2">
		<tbody><tr>
		<td>Servername</td><td>Domainanme</td><td>MBean</td><td>Auswahl</td>
		</tr>
		&lt;%= Content %&gt;
		</tbody></table>
		<br>
		<center>
			<input type="Submit" name="submit" value="Erstellen">
		</center>
	</form>



My 3rd Jsp:



<title>DomainManager</title>


<portlet:renderurl var="actionURL">
<portlet:param name="jspPage" value="/html/gwdomainmanager/view.jsp" />
</portlet:renderurl>

<form action="<%= actionURL %>" method="post">
<center>
<table border="2" cellpadding="2" cellspacing="2">
<tbody><tr>
<td>Auswahl</td><td>Servername</td><td>Serveradresse</td>
</tr>
&lt;%= Content %&gt;
</tbody></table>
<br>
<input type="hidden" name="action" value="new">
<input type="Submit" name="submit" value="Neue Domain erstellen">
</center>
</form>



I'm thankful for any suggestion what could cause troubles on firefox

Tom Cat
thumbnail
Leo Pratlong, modificado hace 12 años.

RE: Firefox Issues

Expert Mensajes: 363 Fecha de incorporación: 6/07/10 Mensajes recientes
As Amos said, if you put portlet 1 and 2 on the same page, you will have a problem with non-unic id/name on the "action" hidden input.

Behind each name or id, put "<portlet:namespace />".
In your code, it will look like:


<input type="hidden" name="<portlet:namespace />action" value="new">



Moreover, with your code, your input does not have an ID. So, you "getElementById" can not work. You have to specify "id" attribute on your input if you want to get it easily.
Or, use <aui> taglib which will write it for you.
thumbnail
Tom Cat, modificado hace 12 años.

RE: Firefox Issues

Junior Member Mensajes: 34 Fecha de incorporación: 14/07/11 Mensajes recientes
tried it out with aui elements and id. Anyway it didn't work.
But it's ok. No Firefox support now for that portlet : D
thumbnail
David García González, modificado hace 12 años.

RE: Firefox Issues

Regular Member Mensajes: 127 Fecha de incorporación: 14/07/09 Mensajes recientes
Hi,
In IE 9 this component is adding this clases to the html tag: yui3-js-enabled trident ltr js ie ie7 ie7-0 win

So, the final markup is the following:


...


Why in IE9 this is adding the class "ie7 ie7-0"??

I don't understad.

Thanks to everybody!!