前台JSP--/demo_my/EAPDomain/app/pages/samples/server/norole/norole.jsp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <%@ page contentType="text/html; charset=UTF-8" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </meta> <title>动态级联</title> <%@ include file="/unieap/ria3.3/pages/config.jsp" %> <script type="text/javascript" src="<%=appPath%>/pages/samples/server/norole/norole.js"></script> </head> <body class="unieap"> <div style="width:100%;"> <div id="rightContent" style="float:left;width:50%;"> <div dojoType="unieap.layout.TitlePane" title="地区管理" style="height:350px"> <form id="empForm" jsId="empForm" dojoType="unieap.form.Form" binding="{store:'area',bindIndex:1}"> <fieldset dojoType="unieap.form.FieldSet" title="地区信息"> <table width="100%" style="table-layout:fixed" > <colgroup> <col style="width:70px;"></col> <col style="width:auto;"></col> <col style="width:20px;"></col> </colgroup> <tr style="height:40px"> <td><label> 城市: </label></td> <td colspan="2"><div binding="{name:'NAME'}" dojoType="unieap.form.ComboBox" dataProvider="{store:'area'}" decoder="{displayAttr:'NAME',valueAttr:'ID'}" width="100%"></div></td> </tr> <tr style="height:40px"> <td><label> 县、区: </label></td> <td colspan="2"><div binding="{name:'NAME'}" id="area" dojoType="unieap.form.ComboBox" dataProvider="{store:'area'}" decoder="{displayAttr:'NAME',valueAttr:'ID'}" width="100%"></div></td> </tr> <tr style="height:40px"> <td><label> 公司: </label></td> <td colspan="2"><div binding="{name:'NAME'}" dojoType="unieap.form.ComboBox" dataProvider="{store:'area'}" decoder="{displayAttr:'NAME',valueAttr:'ID'}" width="100%"></div></td> </tr> </table> </fieldset> </form> </div> </div> </div> </body> </html>
无后台JS业务处理--/demo_my/EAPDomain/app/pages/samples/server/norole/norole.js
dojo.addOnLoad(function(){ init(); }); function init(){ var dc = new unieap.ds.DataCenter(); var store=new unieap.ds.DataStore("area"); store.setRowSetName("areaStore"); dc.addDataStore(store); //调用查询方法,返回dc unieap.Action.doQuery(store); var ds = dataCenter.getDataStore("area"); //重新绑定数据源 unieap.debug(ds.getRowSet()); var row=ds.getRowSet().getRow(0); var form=unieap.byId('empForm'); form.getBinding().bind(row); }