Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem to display "boxes"  RSS feed

 
Marco Phu
Greenhorn
Posts: 4
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there.

I've got a little problem, but i didn't find any answers in google.

I try to display some "boxes".

i defined them in a css-file:
f.e.:


in html , i just can write <div id="header" > and the box will be displayed.

how is this possible in JSF? I just want to display some boxes, defined in a CSS-file.

Thank you in advance.

Best regards Phu.
 
Tim Holloway
Bartender
Posts: 18661
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Marco!

There are several JSF tags that can generate HTML divs, although a table may also work for what you want. A panelGrid for a 1x1 panel could be given an id of "header" and should work for you.

Normally I encourage use of JSF tags and avoidance of raw HTML tags. However, if you're looking more for artistic effect than for actual form functionality, you may find it easier to simply define your boxes using raw divs, especially if they're going to overlap. You can use the f:verbatim tag to enclose them.
 
Marco Phu
Greenhorn
Posts: 4
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim.

Thank you, i visited the site many times, but just registered today ;D

Before i posted this here, i tried with panelGrid and defined a styleClass.

But it wasn't displayed, like i expected.

I now tried with verbatim-tag, and it works fine.
is this a dirty method and i should better avoid things like this?

My thought was, to split the side in a header, a navigation etc. and didn't see another way then the one with
the boxes.

If you may could explain the other method a little more detailed and maybe with a little example,
i'd be very thankful

Sorry for my english.

Regards Marco
 
Tim Holloway
Bartender
Posts: 18661
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your English is fine. No problem there.

However, it sounds like what you want is to "tile" the screen into rectangular areas such as menu sidebars.

For that, one of the best solutions is to use Facelets, which are the "ui" tags. Facelets allows you to easily create page templates so that you don't have to spend a lot of time setting up the "boxes" on each individual webpage.

However, Facelets itself won't do the layout. To do that, you're generally best off using a table-type setup. The panelGrid tag operates like the HTML table except that it doesn't support row/column spans. It's what I use for stuff like that. You can do things with it like set columnclasses so that the sidebar column rows are all set to a fixed width.
 
Marco Phu
Greenhorn
Posts: 4
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i've just seen, that JSF-Tags nested in a verbatim-tag will be ignored.

So i will have a look at faclets.

Thank you anyway ;)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!