14時32分05秒
<<< >>>コントローラ層
1.最初に現在の列に対応する医師IDパラメータ情報を照会
医師の照会情報がページの現在の分類情報が決定されるdoctorCategoryid 2。
リスト3.クエリは、すべての分類情報の設定した
フロントデスクのモデルを通じて4.データ転送を
1つの @RequestMapping( "/ doctorManager_update / {ID}" ) 2 パブリック文字列doctorManagerUpdate(@PathVariable整数ID、モデルモデル){ 3 // 查询医生、医生分类、分类列表 4 医師の医師= doctorMapper.selectById(ID)。 5 DoctorCategory doctorCategoryInfo = doctorCategoryDao.selectById(doctor.getDoctorCategoryid())。 6 一覧<DoctorCategory>リスト= doctorCategoryDao.selectList(NULL )。 7 8 model.addAttribute( "リスト" 、リスト)。 9 model.addAttribute(医師)。 10 model.addAttribute( "doctorCategoryInfo" 、doctorCategoryInfo)。 11 12 リターン PREFIX + "doctorManager_edit.html" 。 13 }
<<< >>>ゾーンドロップダウンボックスのページ
のために分類されたデータのセットを介して1ループ。
分析場合2.を繰り返して、オプションを介して濾過します
1 < #select ID = "doctorCategoryid" 名前= "医生职务" > 2 < オプション値= "$ {doctorCategoryInfo.id}" 隠れ= "$ {doctorCategoryInfo.id}" > $ {doctorCategoryInfo.type} </ オプション> 3 @For(doctorCategoryリストで){ 4 @If(doctorCategory.id!= doctorCategoryInfo.id){ 5 < オプション値= "$ {doctorCategory.id}" > $ {doctorCategory.type} </ オプション> 6 @} 7 @} 8 </#select >
<<< >>>レンダリング
1.ドロップダウンボックスは、デフォルトで選択されたオプションが表示されません