Hello. I have a little complicated layout requirement and I decided to use af:panelGridLayout.
Let's say I have this kind of table:
|Header 1||Header 2||Header 3|
There is a cell in which TEXT is located and I need to set a background color of this cell.
But when I set this af:gridCell background or border I can see that in fact the cell is not stretched but only surrounds its content - so the background is only behind TEXT but not whole cell space.
How do I force the cell to stretch so I could set background for the whole table cell?
from the tag documentation:
So the problem is less that the cell doesn't stretch but that the text field doesn't want to be stretched. Can you surround the text field with a panelLabelAndMessage component and apply the background color to this component ?
Surrounded text with plam. Same result: background is only around actual content.
<af:gridCell marginStart="0px" width="100px" id="gc12" columnSpan="4" halign="stretch" valign="stretch"> <af:panelLabelAndMessage label="Label 1" id="plam1" inlineStyle="background-color: #7baab8;"> <af:outputText value="TEXT" id="ot7"/> </af:panelLabelAndMessage> </af:gridCell>
columnSpan doesn't change anything.
Tried with vertical panelGroupLayout instead of plam and it gives better result. Now the obstacle is higher cells which do not stretch again! Oh boy. I'll try to manage it.
What would be correct width value for the cell that should take all the space that is left after all other cells with fixed width?
It has "width=100%", "stretch" for halign and valign, vertical panelGroupLayout inside and doesn't want to stretch again.
I don't know how is it calculating its width currently because now its content text exceeds its border!
I have exactly the same look now: http://goo.gl/nkm4sU
PanelGrid is the layout to go forward with, it's worth learning only due to the power compared to psl, but it also will gain future performance gains with no changes on your part. It's easier than gridBag with Swing, so we are lucky in that respect. When all the browsers implement CSS grid, and the View team gets that done, you will get big performance gains on the client, since that component is currently laid out in client js. I can understand your frustration with panelGrid, and I submitted a few bugs against it when I started using it because my expectations were incorrect. PanelStretch will probably never be removed, but it will also never be improved.
What you want to do is on the component demo, so it might be worth it to push through. If you plan on doing mobile ADF, you don't have psl, another benefit of knowing the grid.