隨筆-39  評論-33  文章-0  trackbacks-0

          newxy Delphi 開發風格二(主細表)

          胡立新

          ?

          newxy 新坐標開發主細表結構的頁面極其簡單,如同 Delphi 。下面討論如何利用 newxy 新坐標的標簽創建主細表結構。

          設主表 industry( 行業 ) ,相關 formBean formIndustry ,保存在會話中,細表 enterprise( 企業 ) ,相關的 formBean formEnterprise ,可保存在會話中,也可保存在 pageContext 中。

          注意, newxy 的通用動態 formBean 含一集合屬性 _coll ,保存記錄集。

          一、 例圖, 演示

          圖上所示為點擊了“制造業”后顯示的相關企業。

          二、 策略

          1、 ? jsp 頁面上得到兩個 formBean ,分表是主表 formBean ,設名為 formIndustry ,細表 formBean ,設名為 formEnterprise

          2、 ? 主表 formBean(formIndustry) 可以在本 jsp 頁上產生,也可直接從會話中得到,細表 formBean 要在本 jsp 頁上形成。從主表 formBean(formIndustry) 上得到細表的外鍵 code (行業代碼),再由這外鍵作為查詢條件查得細表 formBean(formEnterprise)

          3、 ? 將主細表信息顯示出來。

          三、 實現 ( 黑體為 newxy 的標簽 )

          1、 ? 查詢得主表 formBean(formIndustry)

          <nbean:formBean?name="formIndustry"?sql="select?*?from?table_"? />

          2、 ? 顯示主表;

          ????????<nlogic:iterate?id="rec"?name="formIndustry"?property="_coll"?leftover="true">
          ????????<nhtml:TR?onclick="edit(actIndustry);">

          ??????????<td?style="cursor:hand"?align="center">1</td>
          ??????????<td?style="cursor:hand"><nbean:write?name="rec"?property="industry"/></td>
          ????????</nhtml:TR>

          ????????</nlogic:iterate>

          3、 ? 得到主表當前關鍵字值(行業代碼),存入 pageContext

          ??? <bean:define?id=" _code "?name="formIndustry"?property=" code "/>

          4、 ? 根據行業代碼查詢得到細表 formBean(formEnterprise)

          <nbean:formBean?name="formEnterprise"?sql="select?*?from?enterprise?where?industry_code=''$ {_code}"/>

          5、 ? 顯示細表:

          ????????<nlogic:iterate?id="rec"?name="formEnterprise"?property="_coll"?leftover="true">
          ????????<nhtml:TR>

          ??????????<td?align="center">
          ????????????$ {index+1}
          ??????????</td>
          ??????????<td?style="cursor:hand"><nbean:write?name="rec"?property="principal"/></td>
          ??????????<td?style="cursor:hand"><nbean:write?name="rec"?property="name"/></td>
          ????????</nhtml:TR>

          ????????</nlogic:iterate>

          四、 相關連接

          1、 ? newxy 新坐標技術網站 http://www.newxy.net

          2、 ? 在線演示: newxy delphi 開發風格二(主細表) http://demo.newxy.net/delphi/sample2.jsp

          3、 ? 在線演示: newxy delphi 開發風格一 http://demo.newxy.net/delphi/sample1.jsp

          4、 ? DAO + 通用持久類 + 通用動態 formBean 類,實現數據增、刪、改、查 http://www.newxy.net/zh_cn/introduction/application/index.jsp?item=daoDtoAndForm

          5、 ? DynaFormBean 類的特點 http://www.newxy.net/zh_cn/introduction/docs/doc.jsp#anchor9.3

          6、 ? newxy Delphi 開發風格二(主細表) JSP 源碼 http://demo.newxy.net/delphi/sample2_jsp.jsp

          posted on 2007-03-25 00:28 newxy新坐標 閱讀(1561) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2007年3月>
          25262728123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          常用鏈接

          留言簿(4)

          隨筆檔案(39)

          文章分類

          GIS技術及運用

          struts

          實用代碼

          報表

          軟件工程

          搜索

          •  

          積分與排名

          • 積分 - 44075
          • 排名 - 1090

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 井冈山市| 金昌市| 新沂市| 枞阳县| 长子县| 巴东县| 马尔康县| 汤原县| 公安县| 博罗县| 红原县| 名山县| 巫山县| 平湖市| 洱源县| 内江市| 卫辉市| 安图县| 吴忠市| 湖南省| 唐河县| 迁西县| 城口县| 阿荣旗| 苍溪县| 汉沽区| 奉节县| 普洱| 安化县| 陵川县| 三门峡市| 锡林浩特市| 杭锦后旗| 桃源县| 高阳县| 克什克腾旗| 浏阳市| 芦山县| 大方县| 冷水江市| 普安县|