Primefaces + Chrome = Problem

UI Components for JSF
fantacone
Posts: 16
Joined: 13 Jan 2011, 23:40

13 Jan 2011, 23:58

Hello People;

First, sorry my bad english, but I'm brazilian... I hope you understand...

I'm using the Release Candidate 2 of Primefaces, with JSF 2... until here ...ok...

But when I test my aplication at Chrome Browser, the things don't go fine....

See my source code...

Code: Select all

 
  <html xmlns="http://www.w3.org/1999/xhtml"  
       xmlns:f="http://java.sun.com/jsf/core"    
       xmlns:h="http://java.sun.com/jsf/html"  
       xmlns:ui="http://java.sun.com/jsf/facelets"  
       xmlns:p="http://primefaces.prime.com.tr/ui">  
     
   <h:head>  
       <title> Titulo </title>  
   </h:head>  
     
   <h:body>  
     
       <f:view contentType="text/html">  
       <p:menubar>    
         
           <p:submenu label="Menu 1" >    
                   <p:menuitem  value="Name so Bigeeeeeeer" url="#" />  
           </p:submenu>  
     
           <p:submenu label="Menu 2" >    
                   <p:menuitem value="Name so Bigeeeeeeer"  url="#"  />  
           </p:submenu>  
             
             
       </p:menubar>  
         
       <br/>  
         
           <p:password minLength="6" goodLabel="good" weakLabel="weak" promptLabel="label default" strongLabel="strong" />  
       </f:view>  
   </h:body>  
     
   </html>  
So... If I Don't use the f:view tag, the code of javascript generetade by Primefaces/JSF is comented by Google Chrome....

If I use the f:view tag, the code is OK, but my menu sometimes can't render fine... how it have's a sun with a most big name, the browser show me all unalined...

below, there are two codes... both from source code ... the first from Google Chrome... the second from Firefox.... see in the first the javascript was been comented but at firefox is ok... PS.: At Internet Explorer it's all right too....

Chrome

Code: Select all

    <input id="j_idt11" name="j_idt11" type="password" value="" /><script type="text/javascript">   
    //<![CDATA[  
    jQuery(function(){widget_j_idt11 = new PrimeFaces.widget.Password('j_idt11', {length:6,promptLabel:'label default',weakLabel:'weak',goodLabel:'good',strongLabel:'strong'});});  
    //]]>  
    </script>  
Firefox

Code: Select all

    <input id="j_idt11" name="j_idt11" type="password" value="" /><script type="text/javascript">  
    jQuery(function(){widget_j_idt11 = new PrimeFaces.widget.Password('j_idt11', {length:6,promptLabel:'label default',weakLabel:'weak',goodLabel:'good',strongLabel:'strong'});});  
    </script>  
I wrot at others sites: In JSF2 don't use f:view tag.... Ok... no problem, but what can I use??

Thank you very mutch.... I hope for your help...

Bye

healeyb
Posts: 365
Joined: 07 Apr 2010, 16:05

14 Jan 2011, 00:14

How about moving the f:view contentType= to enclose both the header
and body? this is what I do and it works ok with Chrome for me. Well,
I do get occasional problems rendering pages, particularly dataTables,
I'm not sure if this is related to the fact that I'm redeploying all the time
or not. This happens with IE8 and Chrome. I'm quite interested in this
issue, I'll schedule in a http monitor session and see if I can figure out
what's going on at my end, but most of the time it does work using
f:view contentType=.

Regards,
Brendan.

fantacone
Posts: 16
Joined: 13 Jan 2011, 23:40

14 Jan 2011, 00:27

Hy Brendan,

Thank you very mutch...

But I make this... but I hasn't look....

How I sad... when I use the f:view tag, the p:password be all right... but the other componente, in this case the Menu somethimes can't renderize ok....

But only at Google Chrome... I wrote at some forum... The Chrome, like Safari... and others browser are of kind WebKit.... e for this need use f:view... why??


So... thank you very mutch again... I'm continue find a solution....

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Jan 2011, 00:30

I guess this was answered thousand times;

Code: Select all

<f:view contentType="text/html">
page content
</f:view>
Sample template;

http://code.google.com/p/primefaces/sou ... s/ui.xhtml

healeyb
Posts: 365
Joined: 07 Apr 2010, 16:05

14 Jan 2011, 00:32

He is using contentType="text/html" though. My initial answer said the
same thing, then I scrolled down the code... what I'm suggesting is

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml"  
       xmlns:f="http://java.sun.com/jsf/core"    
       xmlns:h="http://java.sun.com/jsf/html"  
       xmlns:ui="http://java.sun.com/jsf/facelets"  
       xmlns:p="http://primefaces.prime.com.tr/ui">  
<f:view contentType="text/html">
  <h:head>
  </h:head>
  <h:body>
  </h:body>
</f:view]
</html>
Regards,
Brendan.

fantacone
Posts: 16
Joined: 13 Jan 2011, 23:40

14 Jan 2011, 00:39

Hi Optimus...

Sorry but this isn't what you are tinking...

I too read many times articles about the problem with Chrome and others... all need f:view... i know this... but if you copy my source code and crate a page to test will see my problem...

Whe I use the tag f:view my problem with p:password get out... but there are a problem whit the render of menu... sometimes it is not shown fine... is misaligned... and whe i whereas the mouse over it... the tings rigth again...

and... is or no to use f:view at JSF2?? I too wrote simetime to not use....

Hugs...

fantacone
Posts: 16
Joined: 13 Jan 2011, 23:40

14 Jan 2011, 11:26

So... I will need to migrate for Icefaces????

Please... today is my last dat to comprove for Bos the supremacy of Primefaces...

I hope for your answers....

Thank's a lot....

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Jan 2011, 11:43

First f:view is absolutely necessary for PrimeFaces to work with webkit browsers such as chrome and safari otherwise they set content type like application/xhtml something weird. f:view has also other use cases like setting view locale.

I've tested your code, had an issue with menubar alignment time to time, when I mouseover item 1, it shrinks, something to check for us. I've seen that in an app too.

Password component worked fine.

Fonts of themes can be big, user's guide states that and provides a solution on how to make them smaller;

Code: Select all

.ui-widget {
    font-size: 75% !important;
}
We'll look at menubar issue.


fantacone
Posts: 16
Joined: 13 Jan 2011, 23:40

14 Jan 2011, 12:56

Hi Optimus....

Thanks for your answer....

I tried to change font size, but the problem continue...

I saw your post at <<Issue 1618>>. It's mean the my occurrence is a problem of Primefaces?

One more time, thank you so much....

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 36 guests