Uploaded image for project: 'PUBLIC - Liferay IDE'
  1. PUBLIC - Liferay IDE
  2. IDE-1388

Contents of view.xhtml file differ between wizards

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.1.0
    • Component/s: Wizards, Wizards > JSF
    • Labels:
      None

      Description

      Create a project (and a portlet) as follows:

      right click -> New -> Liferay Plugin Project

      • Project Name: inventory
      • leave default location checked
      • Build Type: Ant
      • Plugins SDK: liferay-plugins-sdk-6.2.0
      • Liferay runtime: liferay-portal-6.2.0-ga1-jsf-2.1_tomcat-7.0.42
      • Select the plugin type: Portlet
        Next
      • Select the portlet framework: JSF 2.x
      • JSF Component Suite: Liferay Faces Alloy
        Finish

      create another portlet as follows:
      right click -> New -> Liferay JSF Portlet

      • change Portlet class from "org.portletfaces.bridge.GenericFacesPortlet" to "javax.portlet.faces.GenericFacesPortlet" ... grr (see IDE-1838)
        Next
      • Name: "parts"
      • Display Name: Parts Portlet
      • Title: Parts Portlet
      • change to use XHTML folder: "/views/parts"
        Next
        Finish

      Expected results:
      the view.xhtml file generated from both wizards should look almost identical (except for the portlet name which will be in the "hello-world" key for the i18n message in the body.

      Actual results:
      The names spaces are correct for the new Liferay Plugin Project portlet, but are incorrectly generated by the new Liferay JSF portlet wizard.

      The incorrect portlet view.xhtml contains:

      <?xml version="1.0"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <f:view
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      >
      <h:head />
      <h:body>
      <p>
      #{i18n['parts-hello-world']} in view mode.
      </p>
      </h:body>
      </f:view>

      The correct xhtml should include the following namespaces:

      <?xml version="1.0"?>
      
      <f:view
      	xmlns="http://www.w3.org/1999/xhtml"
      	xmlns:aui="http://liferay.com/faces/aui"
      	xmlns:c="http://java.sun.com/jsp/jstl/core"
      	xmlns:f="http://java.sun.com/jsf/core"
      	xmlns:h="http://java.sun.com/jsf/html"
      	xmlns:ui="http://java.sun.com/jsf/facelets"
      >
      	<h:head />
      	<h:body>
      		<h:outputText value="#{i18n['parts-hello-world']}" />
      	</h:body>
      </f:view>

      Also, if primefaces, richfaces, or icefaces was specified, then the following namespaces should be added respectively:

      xmlns:p="http://primefaces.org/ui"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:ace="http://www.icefaces.org/icefaces/components" and xmlns:icecore="http://www.icefaces.org/icefaces/core"
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 41 weeks, 2 days ago

                  Packages

                  Version Package
                  2.1.0