{"hidden":false,"children":[{"configs":{"itemId":"module"},"expanded":true,"children":[{"configs":{"layout":"fit","itemId":"viewport1"},"expanded":true,"children":[{"configs":{"layout":"card","itemId":"container1"},"expanded":true,"children":[{"configs":{"itemId":"main","html":"<div style='padding:8px;line-height:2;'>\n  <p>这是主页面，可以设计任意样式的HTML5页面。<\/p>\n  <p>所有事件都在根容器container1中监听（在painted事件中设置）。<\/p>\n  <p>以下值将在点击[跳转]按钮时，传递到子页面中。<\/p>\n  <div><input itemId='text1' placeholder='请输入字符' style='width:100%;'/><\/div>\n  <div><input itemId='number1' type='number' placeholder='请输入数字' style='width:100%;'/><\/div>\n  <div style='margin-top:20px;background:#43C475;color:white;cursor:pointer;text-align:center;' tap='toSub1'>跳转<\/div>\n<\/div>","scrollable":"true"},"expanded":false,"children":[],"type":"tcontainer"},{"configs":{"itemId":"sub1","html":"<div style='padding:8px;line-height:2;'>\n  <p>确定要提交以下值到back模块吗？<\/p>\n  <p itemId='p1'><\/p>\n  <p itemId='p2'><\/p>\n  <div style='margin-top:20px;background:#43C475;color:white;cursor:pointer;text-align:center;' tap='submit'>提交<\/div>\n  <div style='margin-top:20px;background:gray;cursor:pointer;text-align:center;' tap='toHome'>返回主页面<\/div>\n<\/div>","scrollable":"true"},"expanded":false,"children":[],"type":"tcontainer"}],"type":"tcontainer","events":{"painted":"element.on({\n  singletap: function(e, node) {\n    var tap = Ext.fly(node).getAttribute('tap');\n    if (tap)\n      app[tap](e, node);\n  },\n  doubletap: function() {\n    Wb.info('双击事件');\n  }\n\n  //更多事件请参考Element\n});"}}],"type":"tviewport"}],"type":"module","events":{"initialize":"Wb.apply(app, {\n  toSub1: function() {\n    var vals = Wb.getInputValue(app.main);\n    if (!vals.text1)\n      Wb.warn('请输入字符。');\n    else if (!vals.number1)\n      Wb.warn('请输入数字。');\n    else {\n      var p1, p2;\n      app.params = vals;\n      app.container1.setActiveItem(app.sub1);\n      p1 = app.sub1.element.down('[itemId=p1]');\n      p2 = app.sub1.element.down('[itemId=p2]');\n      p1.setHtml('字符值：' + vals.text1);\n      p2.setHtml('数字值：' + vals.number1);\n    }\n  },\n  toHome: function() {\n    app.container1.setActiveItem(app.main);\n  },\n  submit: function() {\n    Wb.request({\n      url: 'm?xwl=apps/sys/demo/html/back',\n      params: Wb.getInputValue(app.main),\n      success: function(resp) {\n        Wb.info(resp.responseText);\n      }\n    });\n  }\n});"}}],"roles":{"demo":1},"title":"HTML页面","iconCls":"","inframe":true,"pageLink":""}