Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF and Layouts  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to me that my biggest problem with JSF is laying out pages. Trying to use panelGrid and applying CSS is a bit of a nightmare for me because I suck at design, getting it to look right in different browsers, and the fact that panelGrid spits out a TABLE element. It might have been better if it were implemented so that DIVs and/or SPANs were used instead.

So I pretty much just say screw panelGrids and put JSF components in my own plain jane html elements. It works I suppose. I just wonder if there are any plans to make these kinds of things easier or if this is not a JSF issue but a general layout / web design issue. Which, I'll say it again, I suck at.
 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also use div elements to do most of my layout. JSF is great for the components but I always position them manually.

CSS styles applied to JSF components work pretty well but I would argue that positioning and design is best done using plain old HTML and CSS.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rick Beaver:
I also use div elements to do most of my layout. JSF is great for the components but I always position them manually.

CSS styles applied to JSF components work pretty well but I would argue that positioning and design is best done using plain old HTML and CSS.


I'd agree. But some JSF implementations don't always play nice when mixing standard HTML with JSF components. For example, I was going to use Tiles via MyFaces on a project until I learned there was an issue with the current JSF and JSP spec that screwed layout completely when mixing JSF components with HTML tags. I was then going to look into Facelets but I am afraid it is too new and doesn't have built in support beyond Sun's RI tags. So now everything is just layed out manually.

Although, would like to point out that MyFaces has a t iv tag that I might look into. But that would involve a lot of TABLE replacements in current pages and I just don't have time.
 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agreed. There are some circumstances where HTML inside a JSF view or subview can cause problems. I find that most of the time wrapping your html in a verbatim tag will stop any nastiness.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rick Beaver:
Agreed. There are some circumstances where HTML inside a JSF view or subview can cause problems. I find that most of the time wrapping your html in a verbatim tag will stop any nastiness.


That is true. But that can sometimes be a pain. Especially when TABLE elements have been used for layout. Using verbatim all over TR TD etc is sloppy. Maybe when the JSP2.0 spec comes out, it will solve these problems. It is supposed to anyway. Too bad there isn't a nice clean solution now though.
 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might make you smile. This is what I had to do to get around the fact that outputLink's won't render.


[ October 10, 2005: Message edited by: Rick Beaver ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yea, that is nasty. But you gotta do what you gotta do.
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of these days, I really hope that someone will implement a JSF table tag that supports spanning rows/columns!
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
One of these days, I really hope that someone will implement a JSF table tag that supports spanning rows/columns!


Aint that the truth. Although I don't see it happening real soon. I mean, more and more layouts are being pushed into DIV and SPAN. And data grids that use tables would be difficult to implement such attributes.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tim Holloway:
One of these days, I really hope that someone will implement a JSF table tag that supports spanning rows/columns!


Hey Tim. I just ran across this which might solve the problem. I haven't used it yet to confirm. I was having a problem using Tiles with JSF and I was told on the MyFaces mailing list it was because I was mixing standard HTML and JSF components. With this library, I should be able to fix that problem.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright Tim, I just tried out that library on some pages and it works perfectly. Not only was I able to get rid of *almost* all my verbatim tags, but Tiles with JSF works great now. And I get all the power of the standard HTML markup (rowspan, colspan, etc)

The only place I still need verbatim tags is for the head element and I have an object tag with an embed element that needs it. Much much better.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!