Connie writes in to ask, "How can I programmatically access the currently selected value of a list binding?"
The trick is to understand that the return value of the getSelectedValue() method returns a Row interface giving you the Row of attributes from the list iterator for the currently selected row. Assuming you had a list binding named Mgr and wanted to get the value of the ManagerName attribute from the currently selected row in its list iterator, you'd write code in your data action like this:
JUCtrlListBinding b = (JUCtrlListBinding)ctx.getBindingContainer().findCtrlBinding("Mgr"); Row selectedRow = (Row)b.getSelectedValue(); String name = (String)selectedRow.getAttribute("ManagerName");
9:48:51 AM
|