转载:http://hi.baidu.com/jspring/blog
Html remark = new Html(item.getBalanceTagDesc());
Div div = new Div();
div.appendChild(remark);
Toolbarbutton tb_link = new Toolbarbutton();
tb_link.setImage("/css/images/edit.gif");
tb_link.setTooltiptext("编辑");
tb_link.setStyle("margin-left:10px");
div.appendChild(tb_link);
div.setParent(row);
tb_link.addEventListener(Events.ON_CLICK, new EventListener(){
public void onEvent(Event event) throws Exception {
final Window win = (Window) Executions.createComponents("/pages/express/editExpressBalanceTagRemark.zul", null,null);
win.setPosition("center");
win.setAttribute("dataObject",item);
win.setAttribute("row",row);
win.doModal();
}
});
在win页面就可以直接获取传过去的参数了。
Row row = (Row)getAttribute("row");
Div div = (Div)row.getChildren().get(4);
Html html = (Html)div.getChildren().get(0);
html.setContent(countExpressBalanceTag.getBalanceTagDesc());