ICEfaces
  1. ICEfaces
  2. ICE-2311

<ice:inputRichText /> not rendering in a Liferay Facelets portlet

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7DR#2
    • Fix Version/s: 1.7Beta1, 1.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows / Liferay 4.3.3 / Tomcat 6.0.13

      Description

      When I try to put an <ice:inputRichText /> component in a Liferay Facelets portlet, Firefox reports a JavaScript error on this rendered line in the HTML page:

      <script type="text/javascript">Ice.FCKeditor.register ('_id2:_id4', new Ice.FCKeditor('_id2:_id4', '','da', '', '/icetest-portlet/block/resource/LTQ5MTYyMDg1Mw==/','100%', '200'));</script>

      The error is "Ice.FCKeditor has no properties"

      I've attached a sample portlet that will enable you to reproduce the error. To install, simply copy the attached file to your Liferay "Hot Deploy" folder, and then startup Liferay 4.3.3. The portlet can be found under the "Add Content" menu in the "Sample" category. It is named "ICEfaces Test"

        Issue Links

          Activity

          Hide
          Neil Griffin added a comment -

          Forgot to mention that the JARs included in WEB-INF/lib were built from the trunk with JDK 1.5 on 10/31/2007.

          Show
          Neil Griffin added a comment - Forgot to mention that the JARs included in WEB-INF/lib were built from the trunk with JDK 1.5 on 10/31/2007.
          Hide
          Adnan Durrani added a comment -

          Hi Neil,

          I am using the latest Liferay Portal bundle "liferay-portal-tomcat-6.0-4.3.4" and forsome reason the attached war is not working with it, may be i am not properly launching it. However using the same bundle I have tested the inputRichText component with the dyn-chart (facelets version) demo with JDK 1.5, trunk built on 11/30/2007. The inputRichText component is working fine. Can you please retest your demo with the head.

          Thanks,

          Show
          Adnan Durrani added a comment - Hi Neil, I am using the latest Liferay Portal bundle "liferay-portal-tomcat-6.0-4.3.4" and forsome reason the attached war is not working with it, may be i am not properly launching it. However using the same bundle I have tested the inputRichText component with the dyn-chart (facelets version) demo with JDK 1.5, trunk built on 11/30/2007. The inputRichText component is working fine. Can you please retest your demo with the head. Thanks,
          Hide
          Neil Griffin added a comment -

          Adnan,

          I just did as you asked and I tried my attached icetest-portlet-4.3.3.1.war with liferay 4.3.4+Tomcat (just as you did) and was able to launch it just fine, and reproduce the problem.

          Did you place it in your $HOME/liferay/deploy directory, or did you put it directly in webapps? You must do the former, and not the latter in order to launch it properly.

          Show
          Neil Griffin added a comment - Adnan, I just did as you asked and I tried my attached icetest-portlet-4.3.3.1.war with liferay 4.3.4+Tomcat (just as you did) and was able to launch it just fine, and reproduce the problem. Did you place it in your $HOME/liferay/deploy directory, or did you put it directly in webapps? You must do the former, and not the latter in order to launch it properly.
          Hide
          Adnan Durrani added a comment -

          Hi Neil,

          Yes I did put it in the webapps folder directly. This is the first app I have tested with the portlets, that is why I was not sure if I launched it properly.

          When I have downloaded the bundle I didn't get the liferay/deploy folders?

          Thanks,

          Show
          Adnan Durrani added a comment - Hi Neil, Yes I did put it in the webapps folder directly. This is the first app I have tested with the portlets, that is why I was not sure if I launched it properly. When I have downloaded the bundle I didn't get the liferay/deploy folders? Thanks,
          Hide
          Neil Griffin added a comment -

          Adnan,

          The $HOME/liferay/deploy folder is created by the Liferay+Tomcat bundle after you run the Tomcat startup.bat file.

          On Windows, look for a folder like:
          C:\Documents and Settings\adnan\liferay\deploy

          On MacOS/Linux/Unix, look for something like:
          /home/adnan/liferay/deploy

          See "Installation Instructions" on this page:
          http://www.liferay.com/web/guest/downloads/official_plugins

          Neil

          Show
          Neil Griffin added a comment - Adnan, The $HOME/liferay/deploy folder is created by the Liferay+Tomcat bundle after you run the Tomcat startup.bat file. On Windows, look for a folder like: C:\Documents and Settings\adnan\liferay\deploy On MacOS/Linux/Unix, look for something like: /home/adnan/liferay/deploy See "Installation Instructions" on this page: http://www.liferay.com/web/guest/downloads/official_plugins Neil
          Hide
          Adnan Durrani added a comment -

          Hi Neil,

          Thanks for the information and the link. After copying the plugin into the hot deploy directory, I can see the message "Portlets for icetest-portlet registered successfully" but when I launch the app using the following URL: http://localhost:8080/icetest-portlet/, I see the "HTTP Status 404 - /icetest-portlet/". Any idea?

          Thanks,

          Show
          Adnan Durrani added a comment - Hi Neil, Thanks for the information and the link. After copying the plugin into the hot deploy directory, I can see the message "Portlets for icetest-portlet registered successfully" but when I launch the app using the following URL: http://localhost:8080/icetest-portlet/ , I see the "HTTP Status 404 - /icetest-portlet/". Any idea? Thanks,
          Hide
          Neil Griffin added a comment -

          Adnan,

          Although a portlet is packaged like any other webapp, the portal will prevent you from trying to run it directly from a URL like that. Instead, visit http://localhost:8080 and login to the portal first. The username is test@liferay.com and the password is test. Then, click the "Add Page" button to add a new portal page. Then, under the "Welcome Joe Bloggs" menu, click on "Add Content". You can add the portlet to your portal page by clicking the "Add" button next to it. You'll find it it under the the "Sample" category. It is named "ICEfaces Test".

          Neil

          Show
          Neil Griffin added a comment - Adnan, Although a portlet is packaged like any other webapp, the portal will prevent you from trying to run it directly from a URL like that. Instead, visit http://localhost:8080 and login to the portal first. The username is test@liferay.com and the password is test. Then, click the "Add Page" button to add a new portal page. Then, under the "Welcome Joe Bloggs" menu, click on "Add Content". You can add the portlet to your portal page by clicking the "Add" button next to it. You'll find it it under the the "Sample" category. It is named "ICEfaces Test". Neil
          Hide
          Neil Griffin added a comment -

          As of trunk revision 15355 on 12/12/2007 I'm now seeing a new error. When I have an <ice:inputRichText /> on the .xhtml page, I get the message "URI CREATED JUST ONE" in the console and the Facelet doesn't render at all.

          Show
          Neil Griffin added a comment - As of trunk revision 15355 on 12/12/2007 I'm now seeing a new error. When I have an <ice:inputRichText /> on the .xhtml page, I get the message "URI CREATED JUST ONE" in the console and the Facelet doesn't render at all.
          Hide
          Deryk Sinotte added a comment -

          I've just had an initial look at this. It appears that the InputRichText component registers the FCKEditor JavaScript files that need to be served up with BridgeFacesContext using the loadJavascriptCode() methods. These methods add the locations of the resources to be served when the component is rendered. However, these resources are actually written into the page in the DOMResponseWriter.enhanceHead() method which does not look like it gets executed in a portlet environment. It's likely we need a different mechanism so that the script resources are written into the portlet content directly.

          Show
          Deryk Sinotte added a comment - I've just had an initial look at this. It appears that the InputRichText component registers the FCKEditor JavaScript files that need to be served up with BridgeFacesContext using the loadJavascriptCode() methods. These methods add the locations of the resources to be served when the component is rendered. However, these resources are actually written into the page in the DOMResponseWriter.enhanceHead() method which does not look like it gets executed in a portlet environment. It's likely we need a different mechanism so that the script resources are written into the portlet content directly.
          Hide
          Deryk Sinotte added a comment -

          The problem with this is more general and affects any component that depends on injecting 3rd party JavaScript while running in a portlet environment.

          Show
          Deryk Sinotte added a comment - The problem with this is more general and affects any component that depends on injecting 3rd party JavaScript while running in a portlet environment.
          Hide
          Deryk Sinotte added a comment -

          The common issue of injecting component-specific JavaScript has been fixed. The Rich Text Editor now works in a portlet environment. Resolving as fixed.

          Show
          Deryk Sinotte added a comment - The common issue of injecting component-specific JavaScript has been fixed. The Rich Text Editor now works in a portlet environment. Resolving as fixed.

            People

            • Assignee:
              Unassigned
              Reporter:
              Neil Griffin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: