This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Form layout  RSS feed

 
Marco Noronha
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys, I´m using a panelGrid with 2 columns for my forms...
it looks ok... Something like:



But There´s some fields that CAN stay on the same "row"... because they´re small fields..
Like:
"begin date" - "end date".

I m trying to put them on the same row inside the panelGrid, but isn´t looking pretty...
Something like...

This was my last try... and it isn´t the best! lol


Here´s some tries:

 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if this is what you're looking for, but the h:panelGroup element can be used to bundle up multiple items and have them all appear within the same cell.
 
Marco Noronha
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, but now its ugly..
and the form has much more code:



and still looks ugly:
 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can tidy up the layout some by using embedded panelGrids instead of panelGroup. Especially if you define columnClasses to control cell widths and thus keep things better aligned.
 
Marco Noronha
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:You can tidy up the layout some by using embedded panelGrids instead of panelGroup. Especially if you define columnClasses to control cell widths and thus keep things better aligned.


Ok, I´ll try that! thanks!
 
dennis deems
Ranch Hand
Posts: 808
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is something we would do in our application with colspan. Is that an outmoded approach?
 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dennis Deems wrote:This is something we would do in our application with colspan. Is that an outmoded approach?


Outmoded? I don't know. But JSF doesn't do colspan. Never has. Some JSF extension tag libraries have colspan options, but the core JSF does not.
 
Marco Noronha
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:
Dennis Deems wrote:This is something we would do in our application with colspan. Is that an outmoded approach?


Outmoded? I don't know. But JSF doesn't do colspan. Never has. Some JSF extension tag libraries have colspan options, but the core JSF does not.


I ended up doing this:

panelGrid with 4 columns.

label
field
blankLabel
blankLablek

label
field
label2
field2


got it ?
But too pretty, but... its the less ugly I got!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!