• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create horizontal line in jsf

 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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 ]
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks Tim. I am trying to do it by using CSS.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!