Use the below method to align the column data to center.
E.g numbers to right and image to center(Attachment Shortcut Image)
public static void centerAlignment(OAPageContext pageContext, OAWebBean webBean, String tableRegion, String tableCol)
{
OATableBean tbl = (OATableBean)webBean.findChildRecursive(tableRegion);
tbl.prepareForRendering(pageContext);
DataObjectList dataformat = tbl.getColumnFormats();
DictionaryData data = (DictionaryData)dataformat.getItem(pageContext.findChildIndex(tbl, tableCol));
data.put(UIConstants.CELL_NO_WRAP_FORMAT_KEY, Boolean.TRUE);
}
Can this be used to format more than one column? I am trying to do something similar, only right aligned using COLUMN_DATA_FORMAT_KEY and NUMBER_FORMAT. When I run the page, it only formats the last column that is set programmatically?
ReplyDeletehow to wright this method in AM?
ReplyDelete