|
public void order(Element menuTable) {
Vector allRows = XPathFactory.createXPath("row").evaluate(menuTable); ←−−−1
if (0 >= allRows.size())
return;
for(int i = 0 ; i < allRows.size();i++){
Element row = (Element) allRows.get(i);
if (XPathFactory.createXPath("checkBox[@selected='true']").evaluateAsBoolean(row)) { ←−−−2
String name = XPathFactory.createXPath("cell[position()=1]/@text").evaluateAsString(row); ←−−−3
Integer price = XPathFactory.createXPath("cell[position()=2]/@text").evaluateAsInteger(row); ←−−−3
ClientSession cs = getSession();
cs.getDisplayService().modalAlert(String.format("name=%s price=%s",name,price), "Info", ←−−−4
DisplayService.ALERT_INFORMATION, new String[] { "OK" },
new String[] { "OK" });
}
}
}
|
|