You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Renzo Tomaselli <re...@tecnotp.it> on 2007/12/14 19:30:37 UTC

[Trinidad] using EL in tr:document title

Hi, until now I used tr:document with a fixed title. Now I would pick up 
a title from bundles, using the title attribute such as in:

<tr:document
    xmlns:ui="http://java.sun.com/jsf/facelets"
    title="#{msg['login.title']}"
    ...

but I need to declare "msg" in:

<f:loadBundle basename="#{sessionBean.bundle}" var="msg"/>

in case of components, I declare this at the beginning of any 
ui:component (I use Facelets) included in a html bracket.
But in case of tr:document we start the page straight away declaring it, 
e.g. there is no html declaration.
Where can I place the bundle declaration in this case ?
Thanks -- Renzo


Re: [Trinidad] using EL in tr:document title

Posted by Andrew Robinson <an...@gmail.com>.
I'm confused, if you only have one page, why not just put the
loadBundle before the tr:document tag?

<ui:composition
  ...namespaces here...>
  <f:loadBundle .../>
  <tr:document ... />
<ui:composition>

Since the composition doesn't render anything, this shouldn't hurt at all.

If you IDE hates this, try this instead:

<!DOCTYPE ...(if desired)...>
<html
  ...namespaces here...>
  <body>
    <ui:composition>
      <f:loadBundle .../>
      <tr:document ... />
    </ui:composition>
  </body>
</html>

That way the IDE sees an HTML and BODY tag but will not be included by
facelets because of the ui:composition element.

-Andrew


On Dec 14, 2007 12:46 PM, Renzo Tomaselli <re...@tecnotp.it> wrote:
>
>  Andrew, I don't use templates, only many dynamic components and a single
> page for all. Somewhat unusual, but it works very well.
>  So I have nothing before tr:document. I guess I cannot include another
> "html" pair before tr:document, but on the other hand I miss the scope of
> "msg" there.
>
>  -- Renzo
>
>
>
>  Andrew Robinson wrote:
>  The bundle doesn't render anything, so it doesn't have to be in the
> document tag. Just put it at the top of your template and it will
> always be used (I assume your tr:document is in the template).
>
> On Dec 14, 2007 11:30 AM, Renzo Tomaselli <re...@tecnotp.it>
> wrote:
>
>
>  Hi, until now I used tr:document with a fixed title. Now I would pick up
> a title from bundles, using the title attribute such as in:
>
> <tr:document
>  xmlns:ui="http://java.sun.com/jsf/facelets"
>  title="#{msg['login.title']}"
>  ...
>
> but I need to declare "msg" in:
>
> <f:loadBundle basename="#{sessionBean.bundle}" var="msg"/>
>
> in case of components, I declare this at the beginning of any
> ui:component (I use Facelets) included in a html bracket.
> But in case of tr:document we start the page straight away declaring it,
> e.g. there is no html declaration.
> Where can I place the bundle declaration in this case ?
> Thanks -- Renzo
>
>
>
>
>
>

Re: [Trinidad] using EL in tr:document title

Posted by Andrew Robinson <an...@gmail.com>.
The bundle doesn't render anything, so it doesn't have to be in the
document tag. Just put it at the top of your template and it will
always be used (I assume your tr:document is in the template).

On Dec 14, 2007 11:30 AM, Renzo Tomaselli <re...@tecnotp.it> wrote:
> Hi, until now I used tr:document with a fixed title. Now I would pick up
> a title from bundles, using the title attribute such as in:
>
> <tr:document
>     xmlns:ui="http://java.sun.com/jsf/facelets"
>     title="#{msg['login.title']}"
>     ...
>
> but I need to declare "msg" in:
>
> <f:loadBundle basename="#{sessionBean.bundle}" var="msg"/>
>
> in case of components, I declare this at the beginning of any
> ui:component (I use Facelets) included in a html bracket.
> But in case of tr:document we start the page straight away declaring it,
> e.g. there is no html declaration.
> Where can I place the bundle declaration in this case ?
> Thanks -- Renzo
>
>

Re: [Trinidad] using EL in tr:document title

Posted by Simon Lessard <si...@gmail.com>.
Hello Renzo,

If you're using JSF 1.2, you can use the <resource-bundle> element. With JSF
1.1, you can create yourself something equivalent as a managed bean.
f:loadBundle, is far from the best JSF tag in existence, if you can avoid
it, do so.


Regards,

~ Simon

On Dec 14, 2007 1:30 PM, Renzo Tomaselli <re...@tecnotp.it> wrote:

> Hi, until now I used tr:document with a fixed title. Now I would pick up
> a title from bundles, using the title attribute such as in:
>
> <tr:document
>    xmlns:ui="http://java.sun.com/jsf/facelets"
>    title="#{msg['login.title']}"
>    ...
>
> but I need to declare "msg" in:
>
> <f:loadBundle basename="#{sessionBean.bundle}" var="msg"/>
>
> in case of components, I declare this at the beginning of any
> ui:component (I use Facelets) included in a html bracket.
> But in case of tr:document we start the page straight away declaring it,
> e.g. there is no html declaration.
> Where can I place the bundle declaration in this case ?
> Thanks -- Renzo
>
>