from the tag documentation:
- This component must be a child of a gridRow; it is not valid to use a gridCell inside of another kind of layout container.
- This component can stretch a child component if (1) it is the only component inside of the gridCell, (2) the cell's "halign" is "stretch", (3) the cell's "valign" is "stretch", (4) the effective width of the cell is non-auto, and (5) if the effective height of the cell is non-auto.
- Use only non-geometry style properties like background-color; some of the invalid style (e.g. inlineStyle) properties for a gridCell include width, height, position, display, margin, etc. because the geometry must be managed by the grid structure instead.
- Beware that if you attempt to use width="auto", halign="center", halign="end" in conjunction with cell content that uses unstable, percentage-based widths, you may experience different results in different browsers. If you wish to use these settings, be sure to constraint the width of that cell content.
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.