This discussion is archived
8 Replies Latest reply: Nov 14, 2012 9:56 AM by dvohra21 RSS

Facelets in Jdeveloper ...

yesh nandi Newbie
Currently Being Moderated
Hello:

I am on Jdeveloper 11.1.2.3.0.

I see a Facelets tag library ... but I do not want to create a Facelets tag library.

In an ADF project , in the Create JSF page with document type of Facelets, I do not see any ui tags in the ADF page --- so I am not sure why an ADF page is considered document type facelets. It is just a JSF page that does not seem to be using Facelets technology.

How do I create a facelets template file using the ui:composition tags and ui:define tags ?

Thanks - Yesh
  • 1. Re: Facelets in Jdeveloper ...
    Timo Hahn Oracle ACE
    Currently Being Moderated
    If you create an ADF page the framework assumes that you what to use adf rich faces, hence it shows you the adf tags.

    In your case you can create a normal JSF page (file->new->jsf/facelets->page). Then open the component palette and select facelets from the drop down menu. The tags you are looking for are under the templating node.

    Timo
  • 2. Re: Facelets in Jdeveloper ...
    yesh nandi Newbie
    Currently Being Moderated
    Even if you create a normal, blank JSF page (file->new->jsf/facelets->blank page) in a Jave EE web application, the system assumes it is an ADF page and puts ADF tags in the page. I just want a blank JSF page in which I can create my Facelet based templates .....

    Jdeveloper seems to be totally geared towards ADF development and does not easily let you develop in plain JSF /Facelets. Also, it seems misleading to me to call it Facelets when there are no facelet tags in the ADF page ....

    Am I missing something ?
  • 3. Re: Facelets in Jdeveloper ...
    Timo Hahn Oracle ACE
    Currently Being Moderated
    This is not true. It depends on the kind of workspace you have created. If oyu use a Java EE Application work space and create blank page in it you end up with
    <?xml version='1.0' encoding='windows-1252'?>
    <!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">
        <html xmlns="http://www.w3.org/1999/xhtml">
            <h:head></h:head>
            <h:body>
                <h:form></h:form>
            </h:body>
        </html>
    </f:view>
    Which is what you want, i guess.
    However, if you create a Fusion wen application workspace jdev rightly assumes that you are using ADF and will add such tags into the page.

    Timo

    Edited by: Timo Hahn on 13.11.2012 18:52
    By the way, you can remove the tags and use only the JSF tags (even if you choose a Fusion web application workspace.
  • 4. Re: Facelets in Jdeveloper ...
    yesh nandi Newbie
    Currently Being Moderated
    Timo:

    You are correct. It does not create ADF tags in a Java EE workspace ( Not sure why it did that for me the first time .... perhaps because I was on an ADF application and then swtiched to a JEE application ????? )


    Regarding my other question ---- in an ADF application, why does it call it a Facelets type document when there are no facelet tags (ui) in it ? An ADF page seems to be using only JSF and ADF tags ........

    Yesh
  • 5. Re: Facelets in Jdeveloper ...
    Frank Nimphius Employee ACE
    Currently Being Moderated
    Yesh,

    according to the JSF specification, Facelets is a View Declaration Language, which means it is a container for defining JSF views (similar to JSPX). If you create ADF pages using Facelets then we use Facelets as the component carrying document. There is no rule in JSF that mandates that only Facelets tags must be used in a JSF page based on Facelets

    If you create a page fragment within a JSF project configured to use Facelets, then this is the base source config:
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"></ui:composition>
    Frank
  • 6. Re: Facelets in Jdeveloper ...
    yesh nandi Newbie
    Currently Being Moderated
    Frank:

    The idea of using Facelets to the developer was to reuse code via templating of common UI page tags.

    If an ADF page does not allow me to use Facelets based templating, then I have lost a key advantage of this capability.

    If you are saying that under the hoods, an ADF -Facelets page is using a Facelet container, I am not sure what that means to me as a
    developer. What does a Facelets container do ?

    If I have 10 ADF pages with a common header, 2 -column layout, how and where do I define my common header across all 10 pages ?

    Sorry if my questions seem stupid ---- I am kind of new to the ADF environment ...

    Thanks - Yesh
  • 7. Re: Facelets in Jdeveloper ...
    kdario Expert
    Currently Being Moderated
    >
    If I have 10 ADF pages with a common header, 2 -column layout, how and where do I define my common header across all 10 pages ?
    >
    You can create new page template(New->JSF/Facelets->ADF Page Template) and then base your pages on this template
    or
    add af:pageTemplate to reference existing page template.

    Dario
  • 8. Re: Facelets in Jdeveloper ...
    dvohra21 Oracle ACE
    Currently Being Moderated
    http://www.oracle.com/technetwork/articles/java/facelets-454361.html

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points