1

I have two JSF page namely Home.xhtml and ContentPage.xhtml. First page contains link of another page by clicking that link the second page content gets included in first page. I have defined a style in second page but that is not applying. Please help me.

Home.xhtml

    <h:head>
    <title>Home</title>
</h:head>
<h:body>
    Home page
    <ui:insert name="content">Editable area</ui:insert>
    <h:form><h:commandLink action="ContentPage" value="click"/></h:form>
</h:body>

ContentPage.xhtml

<h:head>
    <title>Content page</title>
    <style>
        .styleFormat{
            color: green;
            font-size: 20pt;
        }
    </style>
</h:head>
<h:body>
    <ui:composition template="Home.xhtml">
        <ui:define name="content">
            <h:outputLabel styleClass="styleFormat">This is some text which is of Green color and having font size 20</h:outputLabel>
        </ui:define>
    </ui:composition>
</h:body>
  • 1
    Why are these all tags there in the template client : ``, ``, `<h:body>`? Contents sitting outside `<ui:composition>` will all be ignored.</ui:composition></h:body> – Tiny Dec 24 '15 at 10:31
  • I got my mistake. That style is not applying because i wrote that outside that's why it was ignored. Thanks Tiny. – Sushil Sharma Dec 24 '15 at 11:53

0 Answers0