final String template = "<li>Record index = {index} Data = {port} : {pname}</li>";
final StringBuffer sb = new StringBuffer();
ml.each(new ArrayListCallback<JavaScriptObject>() {
@Override
public boolean call(JavaScriptObject item_, int index) {
Attribute item = item_.cast();
JsObject data = item.getAttrs(new String[]{"select", "port", "pname"});
String s = "";
if(data.objGetBoolean("select")) {
data.objPut("index", index);
sb.append(Y.Lang().sub(template, data));