ni yg aku buat kat hostel.
Hantar 1 parameter drpd controller nama dia tabId
uiModel.addAttribute("tabId"," blockInfo");
return "collegemains/show";
then baca dalam page
then set value xxxSelected;
last print value xxxSelected masa generate tab.
tapi cara ni guna programmatic, cuba cari guna declarative.
<script type="text/javascript">
dojo.ready(function()
{
var tc = new dijit.layout.TabContainer({ style: "height: 100%; width: 100%;"}, "tc-hostelInfo");
var blockInfoSelected = false;
var hostelPersonnelInfoSelected = false;
var hostelHouseInfoSelected = false;
if ("${param.tabId}"=='blockInfo' ) { blockInfoSelected=true;}
if ("${param.tabId}"==' hostelPersonnelInfo') { hostelPersonnelInfoSelected= true;}
if ("${param.tabId}"==' hostelHouseInfo') { hostelHouseInfoSelected=true;}
var cpBlock = new dijit.layout.ContentPane({
title: "Hostel Block",
href : "${tabHostelBlockUrl}page=1& size=${empty param.size ? 10 : param.size}",
selected: blockInfoSelected, parseOnLoad: blockInfoSelected
});
var cpFellow = new dijit.layout.ContentPane({
title: "Hostel Personnel",
href : "${tabHostelPersonnelUrl}page= 1&size=${empty param.size ? 10 : param.size}",
selected: hostelPersonnelInfoSelected, parseOnLoad: hostelPersonnelInfoSelected
});
var cpUnit = new dijit.layout.ContentPane({
title: "Hostel Unit",
href : "${tabHostelHouseUrl}page=1& size=${empty param.size ? 10 : param.size}",
selected: hostelHouseInfoSelected, parseOnLoad: hostelHouseInfoSelected
});
tc.addChild(cpBlock);
tc.addChild(cpFellow);
//tc.addChild(cpUnit);
tc.startup();
});
</script>
Dev info: Code=IKCM-APR || Framework=DOJO,SPRING || Language=JAVA,JSP
No comments:
Post a Comment