`
79343654
  • 浏览: 44621 次
  • 性别: Icon_minigender_1
  • 来自: 太原
社区版块
存档分类
最新评论

Struts2 jQuery 标签页实例,学习笔记

阅读更多

html代码:

 

<%@ page contentType="text/html;charset=UTF-8"%>

<%@ taglib prefix="s" uri="/struts-tags"%>

<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

<%@ page isELIgnored="false"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- no cache headers -->

<meta http-equiv="Pragma" content="no-cache" />

<meta http-equiv="no-cache" />

<meta http-equiv="Expires" content="-1" />

<meta http-equiv="Cache-Control" content="no-cache" />

<!-- end no cache headers -->

<sj:head locale="zh-CN" jquerytheme="start" />

<link rel="stylesheet" type="text/css" href="css/form.css" />

<link rel="stylesheet" type="text/css" href="css/style.css" />

<script type="text/javascript">

$(document).ready(function() {

$.subscribe('tabcomplete', function(event,ui) {

if($("#productId").val()){

$('#tabpanel').tabs('enable', 1);

$('#tabpanel').tabs('enable', 2);

}

});

$.subscribe('onchange', function(event,ui) {

var tab = event.originalEvent.ui.index;

if(!$("#selectedTab").val()){

$("#selectedTab").val(tab);

}

});

  });

</script>

</head>

<body style="margin: 10px; padding: 0px; font-size: 11px;">

<%@ include file="../fat.jsp"%>

<input type="hidden" id="productId" name="pId" value="${pId}" />

<input type="hidden" id="pName" name="pName" value="${pName}" />

<input type="hidden" id="selectedTab" name="selectedTab" value="${selectedTab}" />

<s:url id="remoteurl1" action="product!input.action?id=%{pId}&selectedTab=0" />

<s:url id="remoteurl2" action="productBusiness!showList.action?pId=%{pId}&pName=%{pName}&selectedTab=1" />

<s:url id="remoteurl3" action="command!query.action?pId=%{pId}&pName=%{pName}&selectedTab=2" />

<sj:tabbedpanel 

    id="tabpanel" 

    spinner="加载中..." 

    disabledTabs="[1,2]" 

    onCompleteTopics="tabcomplete" 

    onChangeTopics="onchange" 

    selectedTab="%{selectedTab}">

      <sj:tab id="tab1" href="%{remoteurl1}" label="基本信息" />

<sj:tab id="tab2" href="%{remoteurl2}" label="产品构成" />

<sj:tab id="tab3" href="%{remoteurl3}" label="产品指令" />

</sj:tabbedpanel>

</body>

</html>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics