You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Henry Chang <he...@hotmail.com> on 2008/07/10 03:41:24 UTC

[Trinidad] How to use ?

Hi all,

 

Can anybody show me the correct way of using the <tr:document> with a link
to an external CSS style sheet and JavaScript file? The documentation says
that it will automatically create each of the standard root elements of an
HTML page such as <html>, <body> and <head>. But there is no attribute in
controlling any of these tags. For example, I would like to write:

 

< head title="Page Title">

    <link href="css/app.css" rel="stylesheet" type="text/css" />

</head>

 

This links to an external CSS style sheet. How do I do that with only
<tr:document>? Currently all my pages do not use <tr:document>, but instead
use the following:

 

<f:view>

  <trh:html> 

    <trh:head title="Page Title">

      <link href="css/app.css" rel="stylesheet" type="text/css" />

    </trh:head>

    <trh:body>

               ...

    </trh:body>

  </trh:html>

</f:view>

 

Is this the right way to use Trinidad?

 

Best Regards,

Henry Chang

 


RE: [Trinidad] How to use ?

Posted by Gerard Donnelly <Ge...@amt-sybex.com>.
You could use the metaContainer facet of tr:document:

	<f:facet name="metaContainer">
		<link rel="stylesheet" href="Path to CSS file"/>
	</f:facet>


G


-----Original Message-----
From: Henry Chang [mailto:henrychang04@hotmail.com] 
Sent: 10 July 2008 06:00
To: 'MyFaces Discussion'
Subject: RE: [Trinidad] How to use <tr:document>?

****** This Message Originated From The Internet Please Be Aware Of
Suspicious Attachments And Content ******
 
Richard,

I see. Thank you very much. But one thing to mention is that as with JSF
1.2, it is not necessary to put <f:verbatim> around normal HTML tags.
This
is known as content interweaving in JSF 1.2.


-Henry Chang

-----Original Message-----
From: Richard Yee [mailto:richard.k.yee@gmail.com] 
Sent: Thursday, July 10, 2008 11:30 AM
To: MyFaces Discussion
Subject: Re: [Trinidad] How to use <tr:document>?

Henry,
This is how I put a link to an external stylesheet in my .jspx files

<?xml version='1.0' encoding='ISO-8859-1'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:c="http://java.sun.com/jstl/core"
          xmlns:trh="http://myfaces.apache.org/trinidad/html"
          xmlns:tr="http://myfaces.apache.org/trinidad">
  <jsp:directive.page contentType="text/html;charset=ISO-8859-1"/>
  <f:view>
    <tr:document title="index">
    <f:verbatim>
      <link rel="stylesheet" href="Path to CSS file"/>
    </f:verbatim>
.
.
.
  </tr:document>
</tr:view>

-Richard

On Wed, Jul 9, 2008 at 6:41 PM, Henry Chang <he...@hotmail.com>
wrote:
> Hi all,
>
>
>
> Can anybody show me the correct way of using the <tr:document> with a
link
> to an external CSS style sheet and JavaScript file? The documentation
says
> that it will automatically create each of the standard root elements
of an
> HTML page such as <html>, <body> and <head>. But there is no attribute
in
> controlling any of these tags. For example, I would like to write:
>
>
>
> < head title="Page Title">
>
>     <link href="css/app.css" rel="stylesheet" type="text/css" />
>
> </head>
>
>
>
> This links to an external CSS style sheet. How do I do that with only
> <tr:document>? Currently all my pages do not use <tr:document>, but
instead
> use the following:
>
>
>
> <f:view>
>
>   <trh:html>
>
>     <trh:head title="Page Title">
>
>       <link href="css/app.css" rel="stylesheet" type="text/css" />
>
>     </trh:head>
>
>     <trh:body>
>
>                ...
>
>     </trh:body>
>
>   </trh:html>
>
> </f:view>
>
>
>
> Is this the right way to use Trinidad?
>
>
>
> Best Regards,
>
> Henry Chang
>
>

 
 
P Please consider the environment before printing this email


P Please consider the environment before printing this email
_________________________________________________________ 
 
1. The information contained in this E-mail, including any files transmitted with it, is confidential and may be legally privileged. This E-mail is intended only for the personal attention of the stated addressee(s). Any access to this E-mail, including any files transmitted with it, by any other person is unauthorised. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this E-mail or any files transmitted with it. Such unauthorised use may be unlawful. If you have received this E-mail in error, please inform the sender immediately and delete it and all copies from your system. You may not forward this E-mail without the permission of the sender.
 
2. The views expressed in this E-mail are those of the author, and do not necessarily represent the views of AMT-SYBEX. Internet communications are not secure and AMT-SYBEX cannot, therefore, accept legal responsibility for the contents of this message nor for any damage caused by viruses.
 
AMT-SYBEX Limited is a UK company, registration number GB03036807 at address The Spirella Building, Bridge Road, Letchworth, SG6 4ET. 
AMT-SYBEX (NI) Limited is a UK company, registration number NI024104 at address Edgewater Office Park, Edgewater Rd, Belfast, BT3 9JQ.
For more information on the AMT-SYBEX Group visit http://www.amt-sybex.com
_________________________________________________________

RE: [Trinidad] How to use ?

Posted by Henry Chang <he...@hotmail.com>.
Richard,

I see. Thank you very much. But one thing to mention is that as with JSF
1.2, it is not necessary to put <f:verbatim> around normal HTML tags. This
is known as content interweaving in JSF 1.2.


-Henry Chang

-----Original Message-----
From: Richard Yee [mailto:richard.k.yee@gmail.com] 
Sent: Thursday, July 10, 2008 11:30 AM
To: MyFaces Discussion
Subject: Re: [Trinidad] How to use <tr:document>?

Henry,
This is how I put a link to an external stylesheet in my .jspx files

<?xml version='1.0' encoding='ISO-8859-1'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:c="http://java.sun.com/jstl/core"
          xmlns:trh="http://myfaces.apache.org/trinidad/html"
          xmlns:tr="http://myfaces.apache.org/trinidad">
  <jsp:directive.page contentType="text/html;charset=ISO-8859-1"/>
  <f:view>
    <tr:document title="index">
    <f:verbatim>
      <link rel="stylesheet" href="Path to CSS file"/>
    </f:verbatim>
.
.
.
  </tr:document>
</tr:view>

-Richard

On Wed, Jul 9, 2008 at 6:41 PM, Henry Chang <he...@hotmail.com>
wrote:
> Hi all,
>
>
>
> Can anybody show me the correct way of using the <tr:document> with a link
> to an external CSS style sheet and JavaScript file? The documentation says
> that it will automatically create each of the standard root elements of an
> HTML page such as <html>, <body> and <head>. But there is no attribute in
> controlling any of these tags. For example, I would like to write:
>
>
>
> < head title="Page Title">
>
>     <link href="css/app.css" rel="stylesheet" type="text/css" />
>
> </head>
>
>
>
> This links to an external CSS style sheet. How do I do that with only
> <tr:document>? Currently all my pages do not use <tr:document>, but
instead
> use the following:
>
>
>
> <f:view>
>
>   <trh:html>
>
>     <trh:head title="Page Title">
>
>       <link href="css/app.css" rel="stylesheet" type="text/css" />
>
>     </trh:head>
>
>     <trh:body>
>
>                ...
>
>     </trh:body>
>
>   </trh:html>
>
> </f:view>
>
>
>
> Is this the right way to use Trinidad?
>
>
>
> Best Regards,
>
> Henry Chang
>
>


Re: [Trinidad] How to use ?

Posted by Torben Makowka <to...@topcom.de>.
Hi,

i think the clean way to do this is to define a metaContainer-facet for 
the document like this:

<tr:document title="index">
   <f:facet name="metaContainer">
     <f:verbatim>
       <link rel="stylesheet" href="Path to CSS file"/>
     </f:verbatim>
   </f:facet>
</tr:document>

We're doing this in our projects and the advantage is that the 
<link>-tag is placed directly into the <head>-container of the page like 
it should be.

Regards,
Torben

Re: [Trinidad] How to use ?

Posted by Richard Yee <ri...@gmail.com>.
Henry,
This is how I put a link to an external stylesheet in my .jspx files

<?xml version='1.0' encoding='ISO-8859-1'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:c="http://java.sun.com/jstl/core"
          xmlns:trh="http://myfaces.apache.org/trinidad/html"
          xmlns:tr="http://myfaces.apache.org/trinidad">
  <jsp:directive.page contentType="text/html;charset=ISO-8859-1"/>
  <f:view>
    <tr:document title="index">
    <f:verbatim>
      <link rel="stylesheet" href="Path to CSS file"/>
    </f:verbatim>
.
.
.
  </tr:document>
</tr:view>

-Richard

On Wed, Jul 9, 2008 at 6:41 PM, Henry Chang <he...@hotmail.com> wrote:
> Hi all,
>
>
>
> Can anybody show me the correct way of using the <tr:document> with a link
> to an external CSS style sheet and JavaScript file? The documentation says
> that it will automatically create each of the standard root elements of an
> HTML page such as <html>, <body> and <head>. But there is no attribute in
> controlling any of these tags. For example, I would like to write:
>
>
>
> < head title="Page Title">
>
>     <link href="css/app.css" rel="stylesheet" type="text/css" />
>
> </head>
>
>
>
> This links to an external CSS style sheet. How do I do that with only
> <tr:document>? Currently all my pages do not use <tr:document>, but instead
> use the following:
>
>
>
> <f:view>
>
>   <trh:html>
>
>     <trh:head title="Page Title">
>
>       <link href="css/app.css" rel="stylesheet" type="text/css" />
>
>     </trh:head>
>
>     <trh:body>
>
>                …..
>
>     </trh:body>
>
>   </trh:html>
>
> </f:view>
>
>
>
> Is this the right way to use Trinidad?
>
>
>
> Best Regards,
>
> Henry Chang
>
>

Re: [Trinidad] How to use ?

Posted by Zigc Junk <zi...@gmail.com>.
Specifically, in your trinidad-config.xml, include

  <skin-family>someSkin</skin-family>

in your trinidad-skins.xml, include something like

  <skin>
    <id>some.desktop</id>
    <family>someSkin</family>
    <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
    <style-sheet-name>skins/skin-1/skin-1.css</style-sheet-name>
  </skin>

Bill

On Thu, Jul 10, 2008 at 10:57 AM, Andrew Robinson
<an...@gmail.com> wrote:
> Trinidad isn't really setup to include individual CSS files. It is
> made to develop skins and set the skin for a particular application,
> view or whatever.
>
> On Thu, Jul 10, 2008 at 9:45 AM, Mathias Walter <ma...@gmx.net> wrote:
>> Ah sorry! I missed that point. I only saw this component a while ago and
>> thought it could be used in this way.
>>
>> --
>> Regards,
>> Mathias
>>
>>> -----Original Message-----
>>> From: Richard Yee [mailto:richard.k.yee@gmail.com]
>>> Sent: Thursday, July 10, 2008 5:35 PM
>>> To: MyFaces Discussion
>>> Subject: Re: [Trinidad] How to use <tr:document>?
>>>
>>>
>>> trh:styleSheet won't work. trh:styleSheet doesn't include a
>>> user-defined stylesheet. From the documentation: "The styleSheet
>>> component generates the style sheet link reference to a generated
>>> Apache Trinidad style sheet."
>>>
>>> -Richard
>>>
>>> On 7/10/08, Mathias Walter <ma...@gmx.net> wrote:
>>> >
>>> > Hi Henry,
>>> >
>>> > why don't you use just <trh:styleSheet>?
>>> >
>>> > --
>>> > Kind regards,
>>> > Mathias
>>> >
>>> > -----Original Message-----
>>> > From: Henry Chang [mailto:henrychang04@hotmail.com]
>>> > Sent: Thursday, July 10, 2008 3:41 AM
>>> > To: MyFaces Discussion
>>> > Subject: [Trinidad] How to use <tr:document>?
>>> >
>>> >
>>> >
>>> >
>>> > Hi all,
>>> >
>>> >
>>> >
>>> > Can anybody show me the correct way of using the
>>> <tr:document> with a link
>>> > to an external CSS style sheet and JavaScript file? The
>>> documentation says
>>> > that it will automatically create each of the standard root
>>> elements of an
>>> > HTML page such as <html>, <body> and <head>. But there is
>>> no attribute in
>>> > controlling any of these tags. For example, I would like to write:
>>> >
>>> >
>>> >
>>> > < head title="Page Title">
>>> >
>>> >     <link href="css/app.css" rel="stylesheet" type="text/css" />
>>> >
>>> > </head>
>>> >
>>> >
>>> >
>>> > This links to an external CSS style sheet. How do I do that
>>> with only
>>> > <tr:document>? Currently all my pages do not use
>>> <tr:document>, but instead
>>> > use the following:
>>> >
>>> >
>>> >
>>> > <f:view>
>>> >
>>> >   <trh:html>
>>> >
>>> >     <trh:head title="Page Title">
>>> >
>>> >       <link href="css/app.css" rel="stylesheet" type="text/css" />
>>> >
>>> >     </trh:head>
>>> >
>>> >     <trh:body>
>>> >
>>> >                ...
>>> >
>>> >     </trh:body>
>>> >
>>> >   </trh:html>
>>> >
>>> > </f:view>
>>> >
>>> >
>>> >
>>> > Is this the right way to use Trinidad?
>>> >
>>> >
>>> >
>>> > Best Regards,
>>> >
>>> > Henry Chang
>>> >
>>> >
>>
>>
>

Re: [Trinidad] How to use ?

Posted by Andrew Robinson <an...@gmail.com>.
Trinidad isn't really setup to include individual CSS files. It is
made to develop skins and set the skin for a particular application,
view or whatever.

On Thu, Jul 10, 2008 at 9:45 AM, Mathias Walter <ma...@gmx.net> wrote:
> Ah sorry! I missed that point. I only saw this component a while ago and
> thought it could be used in this way.
>
> --
> Regards,
> Mathias
>
>> -----Original Message-----
>> From: Richard Yee [mailto:richard.k.yee@gmail.com]
>> Sent: Thursday, July 10, 2008 5:35 PM
>> To: MyFaces Discussion
>> Subject: Re: [Trinidad] How to use <tr:document>?
>>
>>
>> trh:styleSheet won't work. trh:styleSheet doesn't include a
>> user-defined stylesheet. From the documentation: "The styleSheet
>> component generates the style sheet link reference to a generated
>> Apache Trinidad style sheet."
>>
>> -Richard
>>
>> On 7/10/08, Mathias Walter <ma...@gmx.net> wrote:
>> >
>> > Hi Henry,
>> >
>> > why don't you use just <trh:styleSheet>?
>> >
>> > --
>> > Kind regards,
>> > Mathias
>> >
>> > -----Original Message-----
>> > From: Henry Chang [mailto:henrychang04@hotmail.com]
>> > Sent: Thursday, July 10, 2008 3:41 AM
>> > To: MyFaces Discussion
>> > Subject: [Trinidad] How to use <tr:document>?
>> >
>> >
>> >
>> >
>> > Hi all,
>> >
>> >
>> >
>> > Can anybody show me the correct way of using the
>> <tr:document> with a link
>> > to an external CSS style sheet and JavaScript file? The
>> documentation says
>> > that it will automatically create each of the standard root
>> elements of an
>> > HTML page such as <html>, <body> and <head>. But there is
>> no attribute in
>> > controlling any of these tags. For example, I would like to write:
>> >
>> >
>> >
>> > < head title="Page Title">
>> >
>> >     <link href="css/app.css" rel="stylesheet" type="text/css" />
>> >
>> > </head>
>> >
>> >
>> >
>> > This links to an external CSS style sheet. How do I do that
>> with only
>> > <tr:document>? Currently all my pages do not use
>> <tr:document>, but instead
>> > use the following:
>> >
>> >
>> >
>> > <f:view>
>> >
>> >   <trh:html>
>> >
>> >     <trh:head title="Page Title">
>> >
>> >       <link href="css/app.css" rel="stylesheet" type="text/css" />
>> >
>> >     </trh:head>
>> >
>> >     <trh:body>
>> >
>> >                ...
>> >
>> >     </trh:body>
>> >
>> >   </trh:html>
>> >
>> > </f:view>
>> >
>> >
>> >
>> > Is this the right way to use Trinidad?
>> >
>> >
>> >
>> > Best Regards,
>> >
>> > Henry Chang
>> >
>> >
>
>

RE: [Trinidad] How to use ?

Posted by Mathias Walter <ma...@gmx.net>.
Ah sorry! I missed that point. I only saw this component a while ago and
thought it could be used in this way.

--
Regards,
Mathias

> -----Original Message-----
> From: Richard Yee [mailto:richard.k.yee@gmail.com] 
> Sent: Thursday, July 10, 2008 5:35 PM
> To: MyFaces Discussion
> Subject: Re: [Trinidad] How to use <tr:document>?
> 
> 
> trh:styleSheet won't work. trh:styleSheet doesn't include a
> user-defined stylesheet. From the documentation: "The styleSheet
> component generates the style sheet link reference to a generated
> Apache Trinidad style sheet."
> 
> -Richard
> 
> On 7/10/08, Mathias Walter <ma...@gmx.net> wrote:
> >
> > Hi Henry,
> >
> > why don't you use just <trh:styleSheet>?
> >
> > --
> > Kind regards,
> > Mathias
> >
> > -----Original Message-----
> > From: Henry Chang [mailto:henrychang04@hotmail.com]
> > Sent: Thursday, July 10, 2008 3:41 AM
> > To: MyFaces Discussion
> > Subject: [Trinidad] How to use <tr:document>?
> >
> >
> >
> >
> > Hi all,
> >
> >
> >
> > Can anybody show me the correct way of using the 
> <tr:document> with a link
> > to an external CSS style sheet and JavaScript file? The 
> documentation says
> > that it will automatically create each of the standard root 
> elements of an
> > HTML page such as <html>, <body> and <head>. But there is 
> no attribute in
> > controlling any of these tags. For example, I would like to write:
> >
> >
> >
> > < head title="Page Title">
> >
> >     <link href="css/app.css" rel="stylesheet" type="text/css" />
> >
> > </head>
> >
> >
> >
> > This links to an external CSS style sheet. How do I do that 
> with only
> > <tr:document>? Currently all my pages do not use 
> <tr:document>, but instead
> > use the following:
> >
> >
> >
> > <f:view>
> >
> >   <trh:html>
> >
> >     <trh:head title="Page Title">
> >
> >       <link href="css/app.css" rel="stylesheet" type="text/css" />
> >
> >     </trh:head>
> >
> >     <trh:body>
> >
> >                ...
> >
> >     </trh:body>
> >
> >   </trh:html>
> >
> > </f:view>
> >
> >
> >
> > Is this the right way to use Trinidad?
> >
> >
> >
> > Best Regards,
> >
> > Henry Chang
> >
> >


Re: [Trinidad] How to use ?

Posted by Richard Yee <ri...@gmail.com>.
trh:styleSheet won't work. trh:styleSheet doesn't include a
user-defined stylesheet. From the documentation: "The styleSheet
component generates the style sheet link reference to a generated
Apache Trinidad style sheet."

-Richard

On 7/10/08, Mathias Walter <ma...@gmx.net> wrote:
>
> Hi Henry,
>
> why don't you use just <trh:styleSheet>?
>
> --
> Kind regards,
> Mathias
>
> -----Original Message-----
> From: Henry Chang [mailto:henrychang04@hotmail.com]
> Sent: Thursday, July 10, 2008 3:41 AM
> To: MyFaces Discussion
> Subject: [Trinidad] How to use <tr:document>?
>
>
>
>
> Hi all,
>
>
>
> Can anybody show me the correct way of using the <tr:document> with a link
> to an external CSS style sheet and JavaScript file? The documentation says
> that it will automatically create each of the standard root elements of an
> HTML page such as <html>, <body> and <head>. But there is no attribute in
> controlling any of these tags. For example, I would like to write:
>
>
>
> < head title="Page Title">
>
>     <link href="css/app.css" rel="stylesheet" type="text/css" />
>
> </head>
>
>
>
> This links to an external CSS style sheet. How do I do that with only
> <tr:document>? Currently all my pages do not use <tr:document>, but instead
> use the following:
>
>
>
> <f:view>
>
>   <trh:html>
>
>     <trh:head title="Page Title">
>
>       <link href="css/app.css" rel="stylesheet" type="text/css" />
>
>     </trh:head>
>
>     <trh:body>
>
>                …..
>
>     </trh:body>
>
>   </trh:html>
>
> </f:view>
>
>
>
> Is this the right way to use Trinidad?
>
>
>
> Best Regards,
>
> Henry Chang
>
>

RE: [Trinidad] How to use ?

Posted by Mathias Walter <ma...@gmx.net>.
Hi Henry,
 
why don't you use just <trh:styleSheet>?
 
--
Kind regards,
Mathias

-----Original Message-----
From: Henry Chang [mailto:henrychang04@hotmail.com] 
Sent: Thursday, July 10, 2008 3:41 AM
To: MyFaces Discussion 
Subject: [Trinidad] How to use <tr:document>?



Hi all,

 

Can anybody show me the correct way of using the <tr:document> with a link
to an external CSS style sheet and JavaScript file? The documentation says
that it will automatically create each of the standard root elements of an
HTML page such as <html>, <body> and <head>. But there is no attribute in
controlling any of these tags. For example, I would like to write:

 

< head title="Page Title">

    <link href="css/app.css" rel="stylesheet" type="text/css" />

</head>

 

This links to an external CSS style sheet. How do I do that with only
<tr:document>? Currently all my pages do not use <tr:document>, but instead
use the following:

 

<f:view>

  <trh:html> 

    <trh:head title="Page Title">

      <link href="css/app.css" rel="stylesheet" type="text/css" />

    </trh:head>

    <trh:body>

               ...

    </trh:body>

  </trh:html>

</f:view>

 

Is this the right way to use Trinidad?

 

Best Regards,

Henry Chang