Wednesday, September 9, 2009

How to make ADF <af:train> component center aligned?

As you can see the <af:train> component has no 'align' property and so we can't align it at the center of the page as we wanted.

So, you need to put it <af:train> in <af:panelGroupLayout> and set the halign="center" and inlineStyle="width:30%;halign:center;".

<af:panelgrouplayout inlinestyle="width:30%;halign:center;"> halign="center" layout="horizontal" id="trainPnlGrpLyt"> <af:train value="#{controllerContext.currentViewPort.taskFlowContext.trainModel}"> id="train"/> </af:train> </af:panelgrouplayout>

The inlineStyle's width can be changed to 40%, 50%, etc. depending on the number of stops in the train. But, generally a value between 30-40% will suffice your requirement( The lesser the value is the train stops will be truncated and the more the value, the alignment will be incorrect).

1 comment:

Related Posts with Thumbnails