• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to create horizontal line in jsf

 
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do we create a horizontal line in JSF. IN HTML we have <hr/> for this but how to do it in JSF?

To add one more question what is the component for div in JSF?
[ October 02, 2008: Message edited by: Himanshu Gupta ]
 
Saloon Keeper
Posts: 28313
207
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If JSF and HTML were programming languages, JSF would be Java and HTML would be assembly language. You're thinking low-level where you need to think high level. JSF pages are designed in terms of functional elements rather than display primitives, so using things like the div and span tags are not really a good idea. JSF tags generally create whatever low-level tags they need.

Unfortunately, the set of standard JSF tags is far from a complete set of everything you need to make the perfect web page. Sometimes you end up needing to inject some raw HTML. The recommended way to do that is to use the <verbatim> JSF tag to wrap it. The verbatim tag works best when its contents are self-contained, however. Container tags like div/span don't work that well, since <f:verbatim><div></f:verbatim> isn't a proper pairing (no </div> tag). On the other hand, <f:verbatim><hr/></f:verbatim> is OK, allowing for the fact that the hr tag doesn't understand its surroundings.

[ October 02, 2008: Message edited by: Tim Holloway ]
[ October 02, 2008: Message edited by: Tim Holloway ]
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well thanks a lot for your serious help. I really needed this.

One more thing is it considered a good practices to mix JSF and core HTML in verbatim page as I think that this makes page hard to read and understand because the tags become distributed and to change them after inserting, becomes a tedious job.

I understand that JSF which is more like using high level components doesnt provide all the features which HTML do.

To make my requirements more focused I am instructed not to use verbatim tags. Is there any way to work around.

Once again Thanks a lot Tim Holloway for your help. Hope to hear you again here.
[ October 03, 2008: Message edited by: Himanshu Gupta ]
 
Tim Holloway
Saloon Keeper
Posts: 28313
207
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, as I said, JSF as currently supplied may not be sufficient to make pages look exactly as desired. I do occasionally embed HTML to fill the gaps, and I don't always even use the verbatim tag to wrap it.

I fell into bad ways early on, but under certain circumstances "naked" HTML will work on my current implementations. Or I should say XHTML. Someday I may pay for that, but since I'm using xhtml, I expect XSLT will help me out when I need it.

In certain cases, CSS can be used in place of (X)HTML. For example, using the border attributes to do line drawing. In other cases, you may not be as lucky. If HTML is completely forbidden, a custom JSF tag may be appropriate.

Custom JSF tags are extra work, but they do preserve the platform flexibility better, since you can select a tag renderer that's appropriate for the target. Which is especially useful for apps that are supposed to work on both desktop and mobile platforms.

The other advantage of custom JSF is that it helps you keep a consistent look-and-feel across your app pages.
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim. I am trying to do it by using CSS.
 
Do Re Mi Fa So La Tiny Ad
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic