Ich habe eine Hauptseite mit jquery Tabs. Der Inhalt meiner Tab ist eine jsp Seite, die ich aufgenommen habe:jquery tabs - Inhalt von included jsp zu einem anderen
<div id="tabs">
<ul>
<li><a href="#tabs-1">Users</a></li>
</ul>
<div id="tabs-1"> <jsp:include page="users.jsp" /> </div>
</div>
Diese jsp Seite enthält eine Tabelle, die Benutzerdaten anzeigt. Das sind die Header der Tabelle: Ich möchte, dass die letzte Spalte einen "Details" -Link enthält, und wenn es angeklickt wird - ich möchte den Inhalt der Registerkarte auf eine andere JSP-Seite ändern, die die Benutzerdetails zeigt.
paar Fragen:
- wie wechsle ich auf die zweite jsp auf Klick?
Um die Details des angefragten Benutzers zu präsentieren, muss ich irgendwie die userID an die zweite jsp-Seite übergeben. wie mache ich es? Ich habe einen Link, und seine ID ist die userId ich brauche:
<td><a id="<%=user.getUserID()%>">Details</a></td>
ich wirklich bin neu, versucht, meine Frage glotzen, aber ich konnte es nicht alles zusammen zu einer Arbeitslösung piece.
Danke!
Die Ansicht Quelle:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Conf4You</title>
<link type="text/css" href="css/cupertino/jquery-ui-1.8.18.custom.css"
rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#tabs').tabs();
});
</script>
<style type="text/css">
/*demo page css*/
body {
font: 62.5% "Trebuchet MS", sans-serif;
margin: 50px;
}
.demoHeaders {
margin-top: 2em;
}
</style>
</head>
<body>
<!-- Tabs -->
<h2 class="demoHeaders">Tabs</h2>
<div id="tabs">
<ul>
<li><a href="#tabs-1">Users</a></li>
</ul>
<div id="tabs-1">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link type="text/css" href="css/main.css" rel="stylesheet" />
<link type="text/css" href="css/tables/tableList.css" rel="stylesheet" />
</head>
<body>
<p class="horizontal-line">Actions</p>
<p class="horizontal-line">Users</p>
<table cellpadding="0" cellspacing="0" border="0" id="table" class="sortable">
<thead>
<tr>
<th><h3>Name</h3></th>
<th><h3>Phone 1</h3></th>
<th><h3>Phone 2</h3></th>
<th><h3>Email</h3></th>
<th><h3>Company</h3></th>
<th><h3>Last Access</h3></th>
<th class="nosort"><h3>Details</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td>user0</td>
<td>Num10</td>
<td>num20</td>
<td><a style="color: blue;" href="mailto:[email protected]">[email protected]</a></td>
<td>yada</td>
<td>31-03-2012 06:32:34 PM</td>
<td><a id="1" onclick="detailsAction()"
style="color: blue;">Details</a></td>
<!-- todo- change details link -->
</tr>
<tr>
<td>user1</td>
<td>Num11</td>
<td>num21</td>
<td><a style="color: blue;" href="mailto:[email protected]">[email protected]</a></td>
<td>yada</td>
<td>31-03-2012 06:32:34 PM</td>
<td><a id="2" onclick="detailsAction()"
style="color: blue;">Details</a></td>
<!-- todo- change details link -->
</tr>
<tr>
<td>user2</td>
<td>Num12</td>
<td>num22</td>
<td><a style="color: blue;" href="mailto:[email protected]">[email protected]</a></td>
<td>yada</td>
<td>31-03-2012 06:32:34 PM</td>
<td><a id="3" onclick="detailsAction()"
style="color: blue;">Details</a></td>
<!-- todo- change details link -->
</tr>
<tr>
<td>user3</td>
<td>Num13</td>
<td>num23</td>
<td><a style="color: blue;" href="mailto:[email protected]">[email protected]</a></td>
<td>yada</td>
<td>31-03-2012 06:32:34 PM</td>
<td><a id="4" onclick="detailsAction()"
style="color: blue;">Details</a></td>
<!-- todo- change details link -->
</tr>
<tr>
<td>user4</td>
<td>Num14</td>
<td>num24</td>
<td><a style="color: blue;" href="mailto:[email protected]">[email protected]</a></td>
<td>yada</td>
<td>31-03-2012 06:32:34 PM</td>
<td><a id="5" onclick="detailsAction()"
style="color: blue;">Details</a></td>
<!-- todo- change details link -->
</tr>
</tbody>
</table>
<div id="controls">
<div id="perpage">
<select onchange="sorter.size(this.value)">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
<span>Entries Per Page</span> </div>
<div id="navigation"> <img src="css/tables/images/first.gif" width="16" height="16"
alt="First Page" onclick="sorter.move(-1,true)" /> <img
src="css/tables/images/previous.gif" width="16" height="16"
alt="First Page" onclick="sorter.move(-1)" /> <img
src="css/tables/images/next.gif" width="16" height="16"
alt="First Page" onclick="sorter.move(1)" /> <img
src="css/tables/images/last.gif" width="16" height="16"
alt="Last Page" onclick="sorter.move(1,true)" /> </div>
<div id="text"> Displaying Page <span id="currentpage"></span> of <span
id="pagelimit"></span> </div>
</div>
<script type="text/javascript" src="js/tables/script.js"></script>
<script type="text/javascript">
var sorter = new TINY.table.sorter("sorter");
sorter.head = "head";
sorter.asc = "asc";
sorter.desc = "desc";
sorter.even = "evenrow";
sorter.odd = "oddrow";
sorter.evensel = "evenselected";
sorter.oddsel = "oddselected";
sorter.paginate = true;
sorter.currentid = "currentpage";
sorter.limitid = "pagelimit";
sorter.init("table", 1);
</script>
</body>
</html>
</div>
</div>
</body>
</html>
können Sie den HTML-Beitrag ... JSP konvertiert HTML durch Ansicht Sourcer – DG3
getan, fügte die Ansicht Quelle, danke – Blue