Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

JSF Question

Thread view: 
acatejr@gmail.com - 07 Dec 2005 05:51 GMT
Hi,

I am trying to create a .jsp page that uses the h:outputText tag to
display some text that is nested within a div.  I want the text
rendered only when a backing bean has a certain value.  For example:

<f:subview id="map">
 <f:verbatim>
   <div>
     <h:outputText rendered="#{map.hasPoint}" value="Map has a
point"/>
   </div>
 </f:verbatim>
</f:subview>

However, when I test thes the text "Map has point" is rendered outside
the div when hasPoint is true.  I've tried this:

<f:subview id="map">
 <f:verbatim>
   <div>
     <h:outputText rendered="#{map.hasPoint}">
       Map has a point
     </h:outputText>
   </div>
 </f:verbatim>
</f:subview>

but this just displays the text "Map has point" regardless of hasPoint.

Can anyone make a suggestion on how I can accomplish what I am trying?
Thanks in advance.
dh.evolutionnext@gmail.com - 07 Dec 2005 06:32 GMT
Since verbatim is wrapped around non-JSF contents try the following
<f:subview id="map">
 <f:verbatim>
   <div>
 </f:verbatim>
     <h:outputText rendered="#{map.hasPoint}">
       Map has a point
     </h:outputText>
 <f:verbatim>
   </div>
 </f:verbatim>
</f:subview>
hiwa - 07 Dec 2005 10:44 GMT
JSF best and safest practice is not mix it with
HTML elements, JSP elements etc. in a JSF view.

Pure JSF is best and you can pick up from variety
of third party premade components.
Danno - 07 Dec 2005 16:05 GMT
That's very true too.
Carsten Stiller - 14 Dec 2005 11:00 GMT
Hi,

> Pure JSF is best and you can pick up from variety
> of third party premade components.

Is there any other way to include <div>-tags in a jsf-page? I don't want
to use <f:verbatim> tags around html-parts and I don't want to write my
own tag-lib. I only found a way to render <span>-Tags which I don't want
to use for all cases.

Thanks,
Carsten
hiwa - 14 Dec 2005 11:34 GMT
I think JSF basic architecture does not honor
some Jurassic parts of HTML gadgets.
Instead, it extensively uses style and styleclass
attributes as part of JSF components'
standard attributes. For your <h:outputText>
example, however, I don't understand
what are you expecting by using <div>
tags with it. Anyway, you should try achieving
similar or near effect using styles.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.