Tuesday, December 3, 2013

Getting current column name from dynamic view control in managed bean

I followed the standard example provided in the documents as well as visuals by NotesIn9.com

Hence I was trying to obtain my view name from one of the values in the "svals" variable. For some reason all my attempts kept failing and I even got worked up. I was tired and XPageDebugToolbar came to my rescue after a couple of days of headache.

"svals" seemed to hold references of all stuffs present in the page and that was a sheer nonsense in terms of what I was expecting

I got it through the following code fragment

for (Map.Entry entry: svals.entrySet()) {
dBar.info("Key = " + entry.getKey().toString() + ", Value = " + entry.getValue().toString());
}

So I tried using the ColumnDef object to determine the column name and that worked -

 if (colDef.getName().equals("C1")) {
dynamicColumn.setRendered(false);
}

Hurray I got my work complete now :). Hope this helps some one else as well :)

No comments:

Post a Comment