You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Chrisi <ne...@googlemail.com> on 2006/05/19 12:18:19 UTC

Beginner: html-attributes and bean-values

Hello,

it's me again with a non magic beginner question;):

We've got some html templates from our web-agency.
I like to use them in my JSF pages.

In the html template I've got for example the following line:

<DIV class="navigationActive"> lorum .... </DIV>

I need to replace the class-style with a managed bean property and
tried the following:

1.)  <DIV class="<h:outputText value='#{mybean.value}'/>"> lorum .... </DIV>

2.)  <DIV class="${mybean.value}""> lorum .... </DIV>

Nr 1) doesn't work, because the beans value is not placed between the
attributes double quotes.

Nr 2) seems not to work on the first JSF request. An empty String is
returned. On following requests this works.

What is the correct and easy way to populated JSF bean values into
already existing HTML-Code?

Thanks and Greetings
Chrisi

RE: Beginner: html-attributes and bean-values

Posted by Julian Ray <ju...@yahoo.com>.
You might want to look at f:verbatim and some of the tomahawk tags such as
t:htmlTag and t:div which will allow you to make the existing code work if
you can modify the html templates. You should also make sure that any of
your JSF tags are within the f:view tag.

-----Original Message-----
From: Chrisi [mailto:newfreak@googlemail.com] 
Sent: Saturday, May 20, 2006 7:46 AM
To: users@myfaces.apache.org
Subject: Re: Beginner: html-attributes and bean-values

Does anybody has an idea (other than using facelets)?


On 5/19/06, Chrisi <ne...@googlemail.com> wrote:
> Hello,
>
> it's me again with a non magic beginner question;):
>
> We've got some html templates from our web-agency.
> I like to use them in my JSF pages.
>
> In the html template I've got for example the following line:
>
> <DIV class="navigationActive"> lorum .... </DIV>
>
> I need to replace the class-style with a managed bean property and 
> tried the following:
>
> 1.)  <DIV class="<h:outputText value='#{mybean.value}'/>"> lorum .... 
> </DIV>
>
> 2.)  <DIV class="${mybean.value}""> lorum .... </DIV>
>
> Nr 1) doesn't work, because the beans value is not placed between the 
> attributes double quotes.
>
> Nr 2) seems not to work on the first JSF request. An empty String is 
> returned. On following requests this works.
>
> What is the correct and easy way to populated JSF bean values into 
> already existing HTML-Code?
>
> Thanks and Greetings
> Chrisi
>


--
Thanks and Greetings
Chrisi


Re: Beginner: html-attributes and bean-values

Posted by Chrisi <ne...@googlemail.com>.
Does anybody has an idea (other than using facelets)?


On 5/19/06, Chrisi <ne...@googlemail.com> wrote:
> Hello,
>
> it's me again with a non magic beginner question;):
>
> We've got some html templates from our web-agency.
> I like to use them in my JSF pages.
>
> In the html template I've got for example the following line:
>
> <DIV class="navigationActive"> lorum .... </DIV>
>
> I need to replace the class-style with a managed bean property and
> tried the following:
>
> 1.)  <DIV class="<h:outputText value='#{mybean.value}'/>"> lorum .... </DIV>
>
> 2.)  <DIV class="${mybean.value}""> lorum .... </DIV>
>
> Nr 1) doesn't work, because the beans value is not placed between the
> attributes double quotes.
>
> Nr 2) seems not to work on the first JSF request. An empty String is
> returned. On following requests this works.
>
> What is the correct and easy way to populated JSF bean values into
> already existing HTML-Code?
>
> Thanks and Greetings
> Chrisi
>


-- 
Thanks and Greetings
Chrisi