9 Replies Latest reply: Mar 12, 2012 2:52 PM by Antoine Herzog RSS

Troubles with RichFaces when migration from JBoss Portlet Bridge 2.2.0 to 2.3.0.Final

Antoine Herzog Master

Hello,

 

I run a portal, with :

jboss 5.1.0

GateIn 3.2.0 CR1

RichFaces 3.3.3 Final

JBoss Portlet Bridge 2.1.0 FINAL

 

I tried to use the JBoss Portlet Bridge 2.3.0 FINAL and found two problems with RichFaces.

 

I tried 2.2.0 Final : no problems.

so, for the time being, I will use 2.2.0 FINAL.

 

**********

The problems are :

  - no extended CONTROL_SKINNING in the page : the buttons, the panels etc... are not skinned.

  - the ajax action, on buttons, are not working anymore, in the portlet that is in the body.

 

************************************************************************************************************************

***** no extended CONTROL_SKINNING

************************************************************************************************************************

I digged a lot to find what was going on.

I compared the html files, the css files produced by the portal and richfaces.

I ended with this :

 

<link type="text/css" rel="stylesheet" media="rich-extended-skinning" href="/pexpalctnr/pcr/pexvw0010HomePage?portal:windowState=normal&amp;portal:componentId=a87a503a-45ae-41a8-9806-307aae9017bd&amp;portal:resourceID=/org.rf.resorg/richfaces/renderkit/html/css/extended_both.xcss/DB/eAHbud5gRejyGdIAE5UD8A__&amp;portal:cacheLevel=PAGE&amp;portal:type=resource&amp;portal:portletMode=view" class="component">

 

this media="rich-extended-skinning" is not there, with 2.1.0 nor 2.2.0.

 

it prevents the styles to be applied.

with firebug, it is obvious : if removed, the buttons and input fields are skinned again

 

what is it made for ?

as far as I can see, It is odd to have this media value.

but may be this is a new way to manage the RichFaces Skinning Control, with level extended ?

 

any explaination is welcome...

 

may be, if it is a bug : shall I make a JIRA ?

 

************************************************************************************************************************

***** some  ajax actions do not work

************************************************************************************************************************

The second problem is that some Ajax are not working anymore.

In the banner of my portal, the button is working (for the login window).

but in the body, in the central portlet, neither the buttons, nor the calendar nor the panel controls work.

 

I could not search much what's going on.

 

The JS scripts are there.

(The button in the banner is working...)

 

The only difference with JPB 2.2.0, is changing the dependency version of the JPB, and repackage my ear, and restart the portal... then most of the Ajax is not working anymore.

 

Anyone can see the same thing ?

Any idea to solve this ?

 

or shall I make a JIRA ?

 

*********************

Thanks for any explaination, or idea to search how to solve this.

Antoine

JBoss Portal and GateIn (JSR-286), JSF, Richfaces, J2EE, Drools, BRMS.

http://www.sysemo.com/Sysemo-expertise-portails-jboss-portal.php

  • 1. Re: Troubles with RichFaces when migration from JBoss Portlet Bridge 2.2.0 to 2.3.0.Final
    Ken Finnigan Master

    Antoine,

     

    Do you have cut down portlet examples that replicate the two problems you describe above?

     

    That would be beneficial in resolving these errors.

     

    Thanks

    Ken

  • 2. Re: Troubles with RichFaces when migration from JBoss Portlet Bridge 2.2.0 to 2.3.0.Final
    Ken Finnigan Master

    Could you provide the web.xml of the portlet archive?

     

    Does it contain org.richfaces.CONTROL_SKINNING context param in web.xml?

  • 3. Re: Troubles with RichFaces when migration from JBoss Portlet Bridge 2.2.0 to 2.3.0.Final
    Antoine Herzog Master

    Hi Ken,

     

    no, i don't have a portlet or package to replicate the problem.

    I use my whole "in place" portal, yet running perfecly with PBR 2.1.0 and 2.2.0.

     

    I though of it, but it is difficult to extract the portlets and jsf views, as they come with all the coding around, amoung which the security things etc,...

     

    ************************

    the context params in the web.xml :

    there are several wars, with the same config in the web.xml.

    they all have the same problem.

     

    here are only the context param, because the other part are very similar to usual web.xml for jsf/richfaces, but with few details added for security.

     

     <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/portlet.xml</param-value>
     </context-param>
     <context-param>
      <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
      <param-value>false</param-value>
     </context-param>
     <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>false</param-value>
     </context-param>
     <context-param>
      <param-name>facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE</param-name>
      <param-value>false</param-value>
     </context-param>
     <context-param>
      <param-name>facelets.SKIP_COMMENTS</param-name>
      <param-value>true</param-value>
     </context-param>
     <context-param>
      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
      <param-value>.xhtml</param-value>
     </context-param>
     <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>server</param-value>
     </context-param>
     <context-param>
      <param-name>javax.portlet.faces.RENDER_POLICY</param-name>
      <param-value>ALWAYS_DELEGATE</param-value>
     </context-param>
     <context-param>
      <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
      <param-value>false</param-value>
     </context-param>
     <context-param>
      <param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
      <param-value>rfRes</param-value>
     </context-param>
     <context-param>
      <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
      <param-value>org.jboss.portletbridge.application.FaceletPortletViewHandler</param-value>
     </context-param>
     <context-param>
      <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
      <param-value>true</param-value>
     </context-param>
     <context-param>
      <!-- See : JBoss Portlet Bridge Reference Guide : 
      Richfaces does not account for multiple components on the same portal page by default. 
      This following web.xml renders all RichFaces component javascript to be portal friendly.  -->
      <param-name>org.jboss.portletbridge.WRAP_SCRIPTS</param-name>
      <param-value>true</param-value>
     </context-param>
     <context-param>
      <param-name>org.richfaces.CONTROL_SKINNING</param-name>
      <param-value>enable</param-value>
     </context-param>
     <!-- 
     <context-param>
      <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
      <param-value>enable</param-value>
     </context-param>
     <context-param>
      <param-name>org.richfaces.CONTROL_SKINNING_LEVEL</param-name>
      <param-value>extended</param-value>
     </context-param> 
     -->
     <context-param>
      <param-name>org.richfaces.LoadScriptStrategy</param-name>
      <param-value>ALL</param-value>
     </context-param>
     <context-param>
      <param-name>org.richfaces.LoadStyleStrategy</param-name>
      <param-value>ALL</param-value>
     </context-param>
     <context-param>
      <param-name>org.richfaces.SKIN</param-name>
      <!-- <param-value>blueSky</param-value>
      <param-value>classic</param-value>
      <param-value>pexUsualRFSkin</param-value>
      -->
      <param-value>pexUsualRFSkin</param-value>
     </context-param>
    

     

    yes the CONTROL_SKINNING is enable.

     

    I don't use the CONTROL_SKINNING_CLASSES, nor the CONTROL_SKINNING_LEVEL.

    They are there, commented, because I also made some trials with them... but it does not work anyway.

     

    note : every thing was working fine for a year, and is still with PBR 2.2.0 FINAL.

     

    **************************************************************

    I am sorry I cannot dig for this problem more now. I have the portal to set for testing then prod (that's why I tried to update the bridge, just before going to test).

     

    but, if I may : where this "rich-extended-skinning" character string comes from ?

    it does not come from nowhere...

    and alos : what part of the code is building and writting the "link" element, for the CSS ?

    there should be the explaination why there is now a media="rich-extended-skinning" that was not there before.

     

    for the Ajax not working in some portlet, I don't know how to search right know.

    I'll try to make something to reproduce the problem, starting from my code that shows it.

     

    thanks,

    Antoine

    JBoss Portal and GateIn (JSR-286), JSF, Richfaces, J2EE, Drools, BRMS.

    http://www.presta-expert.com/


  • 4. Re: Troubles with RichFaces when migration from JBoss Portlet Bridge 2.2.0 to 2.3.0.Final
    Ken Finnigan Master

    There wasn't anything changed in the Portlet Bridge regarding rich-extended-skinning.  It's a standard feature provided by RichFaces 3.x for skinning, nothing specific to the bridge

     

    My suspicion is that a bug that was fixed for 2.3.0 was previously preventing this from being rendered, and that something else is now broken to prevent it working properly.

  • 5. Re: Troubles with RichFaces when migration from JBoss Portlet Bridge 2.2.0 to 2.3.0.Final
    Ken Finnigan Master

    With regards to the Ajax problem, are there any JS errors in the UI?  For instance, does Firebug show errors?

     

    Can you also confirm which browser you're using?

  • 6. Re: Troubles with RichFaces when migration from JBoss Portlet Bridge 2.2.0 to 2.3.0.Final
    Ken Finnigan Master

    Antoine,

     

    Attached is a sample RichFaces portlet I created from the archetype that uses 2.3.0.Final

     

    On the single page is a panel, input field and button (doesn't do anything, just for visual confirmation).

     

    If I understood the original description of your problem, with this simple portlet the input fields and button wouldn't be skinned the same as the panel (extended skinning), and the switching between different panels didn't work (ajax issue).  Please correct me if this isn't accurate.

     

    From running some tests with this simple portlet, I think I've discovered the problem.

     

    When my simple portlet has org.jboss.portletbridge.WRAP_SCRIPTS set to false, everything works fine, but when set to true I get errors related to https://issues.jboss.org/browse/RF-11975.  Is it possible for you to change this value to false in web.xml and verify the same behavior, or do you have multiple RF portlets on the same portal page?

     

    Ken

  • 7. Re: Troubles with RichFaces when migration from JBoss Portlet Bridge 2.2.0 to 2.3.0.Final
    Antoine Herzog Master

    Hi,

     

    Good news, with WRAP_SCRIPTS set to false, the problems vanishes...

     

    I know the bug RF-11975, as I struggled with it last automn when building another portal.

     

    For this portal today, I don't have two TogglePanel in the same page.

    So, I can set the WRAP_SCRIPTS to false in all the wars, and everything still runs ok.

     

    Note : I have at least 2 portlets with RichFaces on each page. One is the login window, on top right corner of the page, and the other is the body of the page.

    Some pages have 2 portlets in the body, so it make 3 RichFaces portlets.

    All seems to run ok, ... I guess it's because I don't use 2 toggle panel in a page.

     

    ***************

    For :

    If I understood the original description of your problem, with this simple portlet the input fields and button wouldn't be skinned the same as the panel (extended skinning), and the switching between different panels didn't work (ajax issue).  Please correct me if this isn't accurate.

    yes.

    the problems are :

    - Skinning : the buttons, the input fields, and the panel header are not skinned (with extended skinning). They remain with a basic html rendering.

    - Ajax : the buttons do not trigger the actions. The toggle panel do not switch. The calendars do not drop down the panel to chose the date. I cannot see any error happen in the scripts.

     

    ***************

    Could you explain what's going on ?

    And give some indication where in the code (classes, methods?) where the things are done (with and without the problem) ?

     

    Feel free to ask, for testing and helping to solve this.

     

    Thanks a lot for helping.

    Antoine

    JBoss Portal and GateIn (JSR-286), JSF, Richfaces, J2EE, Drools, BRMS.

    http://www.sysemo.com

  • 8. Re: Troubles with RichFaces when migration from JBoss Portlet Bridge 2.2.0 to 2.3.0.Final
    Ken Finnigan Master

    Antoine,

     

    So are both the skinning and ajax problems resolved by setting WRAP_SCRIPTS to false?  It wasn't clear from your previous post as to whether it was resolved?

     

    Ken

  • 9. Re: Troubles with RichFaces when migration from JBoss Portlet Bridge 2.2.0 to 2.3.0.Final
    Antoine Herzog Master

    yes, both...

     

    yes : "the problems vanish..." (without "es" at the end).