db.html
<div th:each="pr, stat: *{mergeMap}">
<tr>
<td><input type="text" name="key" th:value="${pr.key}" /></td>
<td><input type="text" name="value" th:value="${pr.value}" /></td>
</tr>
</div>
On submitting this input, i always get mergeMap to be empty at the Spring Controller. What should be done to get the value of mergeMap?
Controller.java
#RequestMapping(value = "/shot")
public String saveMergeProducts(#ModelAttribute(value="prod") MergedProductInfoDTO prod, BindingResult bindingResult,
Model model, HttpServletRequest request) {
System.out.println(prod.toString());
return "forward:/backoffice/db";
}
HTML
<form action="#" th:action="#{shot}" method="POST" th:object="${prod}">
<tr>
<td><span th:text="${index.index}"></span></td>
<td><input type="text" name="id" th:value="*{id}" th:readonly="readonly" /></td>
<td><input type="text" name="categoryName" th:value="*{categoryName}" th:readonly="readonly" /></td>
<td><input type="text" name="subCategoryName" th:value="*{subCategoryName}" th:readonly="readonly" /></td>
<td><input type="text" name="productBrand" th:value="*{productBrand}" /></td>
<td><input type="text" name="productSubBrand" th:value="*{productSubBrand}" /></td>
<td><input type="text" name="series" th:value="*{series}" /></td>
<td><input type="text" name="model" th:value="*{model}" /></td>
</tr>
<tr>
<td colspan="7">
<tr>
<th>KEY</th>
<th>VALUE</th>
</tr>
<div th:each="pr, stat: *{mergeMap}">
<tr>
<td><input type="text" name="mergeMapKey" th:value="${pr.key}" /></td>
<td><input type="text" name="mergeMapValue" th:value="${pr.value}" /></td>
</tr>
</div>
</table>
</td>
<td><input type="text" name="tags" th:value="*{tags}" /></td>
<td><input type="submit" value="Submit" /></td>
</tr>
To access the Map property of the form-backing bean, use the __${...}__ preprocessor
<div th:each="pr, stat: *{mergeMap}">
<tr>
<td><input type="text" name="value" th:value="${pr.key}" readonly="true"/></td>
<td><input type="text" name="value" th:field="*{mergeMap[__${pr.key}__]}"/></td>
</tr>
</div>
What it does it evaluates the inner expression first before evaluating the whole expression. Note that in this case, ${pr.key} should not be modified so that the update will be reflected to the map property of the bean bound to the form.
Reference : http://www.thymeleaf.org/doc/tutorials/2.1/thymeleafspring.html#dynamic-fields
Related
Why I can only count value for first row, though Jsp displays every row with correct values.
It always pass first row of data to the Servlet. If I choose first row it works, but if I choose any other it takes values of first row and program collapse due to empty string.
#Override
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws
ServletException, IOException {
PrintWriter printWriter = response.getWriter();
String currency = request.getParameter("currency");
int id = Integer.parseInt(request.getParameter("id"));
float rates = Float.parseFloat(request.getParameter("rates"));
float amount =
Float.parseFloat(request.getParameter("amount"));;
float euro = amount * rates;
printWriter.append(String.valueOf(id)).append(" : ");
printWriter.append(currency).append(" - ");
printWriter.append("rate : ").append(String.valueOf(rates));
printWriter.append(" ---> You have got
").append(String.valueOf(euro)).append("
Euros");
}
<form action="/exchangeServlet" method="post">
<table border="1">
<tr>
<th>Currency</th>
<th>Rate</th>
<th>Amount</th>
<th>Action</th>
</tr>
<c:forEach var="tempValue" items="${kalkulatorList}"
varStatus="counter">
<tr>
<input type="hidden" name="id" value="${tempValue.id}">
<td><input type="hidden" name="currency"
value="${tempValue.currency}">${tempValue.currency}</td>
<td><input type="hidden" name="rates"
value="${tempValue.rates}">${tempValue.rates}</td>
<td><input type="number" name="amount" placeholder="enter
amount"/></td>
<td><input type="submit" value="Exchange"></td>
</tr>
</c:forEach>
</table>
</form>
JSP view after loaded data from a xml file:
<tr>
<td><input type="hidden" name="currency"
value="USD">USD</td>
<td><input type="hidden" name="rates"
value="1.0067">1.0067</td>
<td><input type="number" name="amount" value="0.0"
placeholder="enter amount"/></td>
<td><a href="/exchangeServlet?
command=Exchange¤cyId=2">Exchange</a></td>
</tr>
<tr>
<td><input type="hidden" name="currency"
value="JPY">JPY</td>
<td><input type="hidden" name="rates"
value="138.02">138.02</td>
<td><input type="number" name="amount" value="0.0"
placeholder="enter amount"/></td>
<td><a href="/exchangeServlet?
command=Exchange¤cyId=3">Exchange</a></td>
</tr>
<tr>
<td><input type="hidden" name="currency"
value="BGN">BGN</td>
<td><input type="hidden" name="rates"
value="1.9558">1.9558</td>
<td><input type="number" name="amount" value="0.0"
placeholder="enter amount"/></td>
<td><a href="/exchangeServlet?
command=Exchange¤cyId=4">Exchange</a></td>
</tr>
I want save the user data to my database in my dynamic web application , Im using hibernate to save into db, i have the registration page(signup.html) with so many fields and in form action="rs" which is RegisterServlete, but i dont know why im getting this error
HTML :
signup.html
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h1 align="center">REGISTER</h1>
<form action="rs" method="post">
<table>
<!----- First Name ---------------------------------------------------------->
<tr>
<td>FIRST NAME</td>
<td><input type="text" name="First_Name" maxlength="30" /> (max
30 characters a-z and A-Z)</td>
</tr>
<!----- Last Name ---------------------------------------------------------->
<tr>
<td>LAST NAME</td>
<td><input type="text" name="Last_Name" maxlength="30" /> (max
30 characters a-z and A-Z)</td>
</tr>
<!----- Date Of Birth -------------------------------------------------------->
<tr>
<td>AGE</td>
<td><input type="number" name="age" maxlength="10" /></td>
</tr>
<!----- Email Id ---------------------------------------------------------->
<tr>
<td>EMAIL ID</td>
<td><input type="text" name="Email_Id" maxlength="100" /></td>
</tr>
<!----- Mobile Number ---------------------------------------------------------->
<tr>
<td>MOBILE NUMBER</td>
<td><input type="text" name="Mobile_Number" maxlength="10" />
(10 digit number)</td>
</tr>
<!----- Gender ----------------------------------------------------------->
<tr>
<td>GENDER</td>
<td>Male <input type="radio" name="Gender" value="Male" />
Female <input type="radio" name="Gender" value="Female" />
</td>
</tr>
<!----- Address ---------------------------------------------------------->
<!----- City ---------------------------------------------------------->
<tr>
<td>CITY</td>
<td><input type="text" name="City" maxlength="30" /> (max 30
characters a-z and A-Z)</td>
</tr>
<!----- Pin Code ---------------------------------------------------------->
<tr>
<td>PIN CODE</td>
<td><input type="text" name="Pin_Code" maxlength="6" /> (6
digit number)</td>
</tr>
<!----- State ---------------------------------------------------------->
<tr>
<td>STATE</td>
<td><input type="text" name="State" maxlength="30" /> (max 30
characters a-z and A-Z)</td>
</tr>
<!----- Country ---------------------------------------------------------->
<tr>
<td>COUNTRY</td>
<td><input type="text" name="Country" value="India"
readonly="readonly" /></td>
</tr>
<tr>
<td>PASSWORD</td>
<td><input type="password" name="Password" maxlength="30"
min="8" /></td>
</tr>
<tr>
<td>CONFIRM PASSWORD</td>
<td><input type="password" name="Con_password" maxlength="30"
min="8" /></td>
</tr>
<!----- Submit and Reset ------------------------------------------------->
<tr>
<td colspan="2" align="center"><input type="submit"
value="SIGN UP"></td>
</tr>
</table>
</form>
</body>
</html>
Java :
RegisterServlet.java
`package com.train.seat.exchange;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.train.seat.exchange.dao.UserDAO;
import com.train.seat.exchange.dto.UserDTO;
public class RegisterServlet extends HttpServlet {
public RegisterServlet() {
System.out.println("RegisterServlet started");
}
#Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
UserDTO user = new UserDTO();
user.setfName(req.getParameter("First_Name"));
user.setlName(req.getParameter("Last_Name"));
user.setAge(Integer.parseInt("age"));
user.setEmail(req.getParameter("Email_Id"));
user.setMobileNum(Long.parseLong("Mobile_Number"));
user.setGender(req.getParameter("Gender"));
user.setCity(req.getParameter("City"));
user.setState(req.getParameter("State"));
user.setPinCode(Integer.parseInt("Pin_Code"));
user.setCountry(req.getParameter("Country"));
user.setPassword(req.getParameter("Password"));
HttpSession session = req.getSession(true);
UserDAO userdao = new UserDAO();
userdao.registeruser(user);
resp.sendRedirect("login.html");
}
}`
web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>TrainSeatExchange</display-name>
<welcome-file-list>
<welcome-file>signup.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>RegisterServlet</servlet-name>
<servlet-class>com.train.seat.exchange.RegisterServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>RegisterServlet</servlet-name>
<url-pattern>/rs</url-pattern>
</servlet-mapping>
</web-app>
here is my error :
here is project structure
jsp page:
<%#page language="java" contentType="text/html charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Timesheet Page</title>
</head>
<body>
<header>
<h2>WEEKLY TIME SHEET MANAGEMENT V 1.0</h2>
</header>
<form action="TimeSheet" method="post">
<fieldset style="width: 90%">
<legend>Timesheet</legend>
<h2>Time Sheet application</h2>
<table border=1>
<tr><th>Employee ID</th><th>Date</th><th>Time In</th><th>Time Out</th><th>Lunch</th><th>After Lunch Time in</th><th>After Lunch Time out</th><th>Task Description</th><th>Total Hours</th><th>Overtime</th> </tr>
<tr> <td><input type="text" name="empid" required="required" /></td>
<td><input type="date" id="date" name="date"/></td>
<td><input type="time" class="start" name="logintime"/></td>
<td><input type="time" class="end"name="logouttime" /></td>
<td><input type="time" class="lunch" name="lunch" /></td>
<td><input type="time" class="startafterlunch" name="afterlunchlogin"/></td>
<td><input type="time" class="endafterlunch" name="afterlunchlogout"/></td>
<td><input type="textarea" name="task" required="required" /></td>
<td><input class="totalTime" readonly="readonly" /></td>
<td><input class="overTime" readonly="readonly" /></td></tr>
<tr> <td><input type="text" name="empid" required="required" /></td>
<td><input type="date" id="date" name="date"/></td>
<td><input type="time" class="start" name="logintime"/></td>
<td><input type="time" class="end"name="logouttime" /></td>
<td><input type="time" class="lunch" name="lunch" /></td>
<td><input type="time" class="startafterlunch" name="afterlunchlogin"/></td>
<td><input type="time" class="endafterlunch" name="afterlunchlogout"/></td>
<td><input type="textarea" name="task" required="required" /></td>
<td><input class="totalTime" readonly="readonly" /></td>
<td><input class="overTime" readonly="readonly" /></td></tr>
<tr> <td><input type="text" name="empid" required="required" /></td>
<td><input type="date" id="date" name="date"/></td>
<td><input type="time" class="start" name="logintime"/></td>
<td><input type="time" class="end"name="logouttime" /></td>
<td><input type="time" class="lunch" name="lunch" /></td>
<td><input type="time" class="startafterlunch" name="afterlunchlogin"/></td>
<td><input type="time" class="endafterlunch" name="afterlunchlogout"/></td>
<td><input type="textarea" name="task" required="required" /></td>
<td><input class="totalTime" readonly="readonly" /></td>
<td><input class="overTime" readonly="readonly" /></td></tr>
<tr> <td><input type="text" name="empid" required="required" /></td>
<td><input type="date" id="date" name="date"/></td>
<td><input type="time" class="start" name="logintime"/></td>
<td><input type="time" class="end"name="logouttime" /></td>
<td><input type="time" class="lunch" name="lunch" /></td>
<td><input type="time" class="startafterlunch" name="afterlunchlogin"/></td>
<td><input type="time" class="endafterlunch" name="afterlunchlogout"/></td>
<td><input type="textarea" name="task" required="required" /></td>
<td><input class="totalTime" readonly="readonly" /></td>
<td><input class="overTime" readonly="readonly" /></td></tr>
<tr> <td><input type="text" name="empid" required="required" /></td>
<td><input type="date" id="date" name="date"/></td>
<td><input type="time" class="start" name="logintime"/></td>
<td><input type="time" class="end"name="logouttime" /></td>
<td><input type="time" class="lunch" name="lunch" /></td>
<td><input type="time" class="startafterlunch" name="afterlunchlogin"/></td>
<td><input type="time" class="endafterlunch" name="afterlunchlogout"/></td>
<td><input type="textarea" name="task" required="required" /></td>
<td><input class="totalTime" readonly="readonly" /></td>
<td><input class="overTime" readonly="readonly" /></td></tr>
</table>
</fieldset>
<input type="submit" value="Submit">
</form>
Logout
</body>
</html>
EmployeeBean:
Its for only one row.
package com.eis.bean;
public class EmployeeBean {
private String empid;
private java.sql.Date logindate;
private String logintime;
private String logouttime;
private String lunch;
private String afterlunchlogin;
private String afterlunchlogout;
private String task;
private String total;
private String overtime;
public String getEmpid() {
return empid;
}
public void setEmpid(String empid) {
this.empid = empid;
}
public java.sql.Date getLogindate() {
return logindate;
}
public void setLogindate(java.sql.Date logindate) {
this.logindate = logindate;
}
public String getLogintime() {
return logintime;
}
public void setLogintime(String logintime) {
this.logintime = logintime;
}
public String getLogouttime() {
return logouttime;
}
public void setLogouttime(String logouttime) {
this.logouttime = logouttime;
}
public String getLunch() {
return lunch;
}
public void setLunch(String lunch) {
this.lunch = lunch;
}
public String getAfterlunchlogin() {
return afterlunchlogin;
}
public void setAfterlunchlogin(String afterlunchlogin) {
this.afterlunchlogin = afterlunchlogin;
}
public String getAfterlunchlogout() {
return afterlunchlogout;
}
public void setAfterlunchlogout(String afterlunchlogout) {
this.afterlunchlogout = afterlunchlogout;
}
public String getTask() {
return task;
}
public void setTask(String task) {
this.task = task;
}
public String getTotal() {
return total;
}
public void setTotal(String total) {
this.total = total;
}
public String getOvertime() {
return overtime;
}
public void setOvertime(String overtime) {
this.overtime = overtime;
}
#Override
public String toString() {
return "EmployeeBean [empid=" + empid + ",logindate=" + logindate + ", logintime=" + logintime+ ", logouttime=" + logouttime + ", lunch=" + lunch+ ", afterlunchlogin=" + afterlunchlogin+ ", afterlunchlogout=" + afterlunchlogout+ ", task=" + task+ ", total=" + total+ ",overtime=" + overtime+ "]";
}
}
this EmployeeBean is only for 1 row table, but i want to make that for five rows that to I wanted to know how to create multiple EmployeeBean Objects. please help...
Thnaks!
can you try this,
<%! int TOTAL_NUMBER_OF_ROW = 10; %>
<form action="TimeSheet" method="post">
<fieldset style="width: 90%">
<legend>Timesheet</legend>
<h2>Time Sheet application</h2>
<table border=1>
<tr><th>Employee ID</th><th>Date</th><th>Time In</th><th>Time Out</th><th>Lunch</th><th>After Lunch Time in</th><th>After Lunch Time out</th><th>Task Description</th><th>Total Hours</th><th>Overtime</th> </tr>
<%for(int j =0;j<TOTAL_NUMBER_OF_ROW;j++){ %>
<tr>
<td><input type="text" name="empid" required="required" /></td>
<td><input type="date" id="date" name="date"/></td>
<td><input type="time" class="start" name="logintime"/></td>
<td><input type="time" class="end"name="logouttime" /></td>
<td><input type="time" class="lunch" name="lunch" /></td>
<td><input type="time" class="startafterlunch" name="afterlunchlogin"/></td>
<td><input type="time" class="endafterlunch" name="afterlunchlogout"/></td>
<td><input type="textarea" name="task" required="required" /></td>
<td><input class="totalTime" readonly="readonly" /></td>
<td><input class="overTime" readonly="readonly" /></td>
</tr>
<%}%>
</table>
</fieldset>
<input type="submit" value="Submit">
</form>
<form action="addCustServlet" method="POST" name="frmAddUser">
<table>
<tr>
<td><h3 class="templatemo-gold">ID Number: </h3></td>
<td>
<input type="text" name="cust_id" size="12" value="<c:out value="${customer.cust_id}" />" /> <br/><br/></td>
</tr>
<tr>
<td><h3 class="templatemo-gold">Name: </h3></td>
<td><input type="text" name="custName" size="50"
value="<c:out value="${customer.custName}" />" /> <br/><br/></td>
</tr>
<tr>
<td><h3 class="templatemo-gold">Address: </h3></td>
<td><input type="text" name="custAdd" size="50"
value="<c:out value="${customer.custAdd}" />" /><br/><br/></td>
</tr>
<tr>
<td><h3 class="templatemo-gold">Region: </h3></td>
<td><input type="text" name="custRegion" size="50"
value="<c:out value="${customer.custRegion}" />" /><br/><br/></td>
</tr>
<tr>
<td><h3 class="templatemo-gold">Handphone No: </h3></td>
<td><input type="text" name="custHandphoneNo" size="50"
value="<c:out value="${customer.custHandphoneNo}" />" />><br/><br/></td>
</tr>
<tr>
<td><h3 class="templatemo-gold">Phone No: </h3></td>
<td><input type="text" name="custPhoneNo" size="50"
value="<c:out value="${customer.custPhoneNo}" />" /><br/><br/></td>
</tr>
<tr>
<td><h3 class="templatemo-gold">Email: </h3></td>
<td><input type="text" name="custEmail" size="50"
value="<c:out value="${customer.custEmail}" />" /><br/><br/></td>
</tr>
<tr>
<td> <input type="submit" name="submit" class="btn text-uppercase templatemo-btn templatemo-info-btn">Submit </td>
</tr>
</table>
</form>
Whenever I try to insert data using jsp form, it keeps executing nullPointerException as my cust_id is not auto generated or auto increment.
After I click addbutton, servlet sent to updateUser and data cannot be inserted.
Customer customer = new Customer();
customer.setCustName(request.getParameter("custName"));
customer.setCustAdd(request.getParameter("custAdd"));
customer.setCustRegion(request.getParameter("custRegion"));
customer.setCustHandphoneNo(request.getParameter("custHandphoneNo"));
customer.setCustPhoneNo(request.getParameter("custPhoneNo"));
customer.setCustEmail(request.getParameter("custEmail"));
String cust_id = request.getParameter("cust_id");
if(cust_id == null || cust_id.isEmpty())
{
dao.addUser(customer);
}
else
{
customer.setCust_id(cust_id);
dao.updateUser(customer);
}
RequestDispatcher view = request.getRequestDispatcher(LIST_USER);
request.setAttribute("customer", dao.getAllCustomer());
view.forward(request, response);
}
I have 4 columns of radio buttons in a table. Problem: in Wicket, the radio buttons of a same group need to be grouped under one Wicket tag but it's impossible to do it in HTML because a table is declared row by row.
Code example
<table id="table1">
<thead>
<tr>
<td>Group 1</td>
<td>Group 2</td>
<td>Group 3</td>
<td>Group 4</td>
</tr>
</thead>
<tbody>
<tr>
<td>Value 1</td>
<td>Value 2</td>
<td>Value 3</td>
<td>Value 4</td>
</tr>
<tr>
<td><input type="radio" name="group1" wicket:id="g1b1"><\td>
<td><input type="radio" name="group2" wicket:id="g2b1"><\td>
<td><input type="radio" name="group3" wicket:id="g3b1"><\td>
<td><input type="radio" name="group4" wicket:id="g4b1"><\td>
</tr>
<tr>
<td><input type="radio" name="group1" wicket:id="g1b2"><\td>
<td><input type="radio" name="group2" wicket:id="g2b2"><\td>
<td><input type="radio" name="group3" wicket:id="g3b2"><\td>
<td><input type="radio" name="group4" wicket:id="g4b2"><\td>
</tr>
<tr>
<td><input type="radio" name="group1" wicket:id="g1b3"><\td>
<td><input type="radio" name="group2" wicket:id="g2b3"><\td>
<td><input type="radio" name="group3" wicket:id="g3b3"><\td>
<td><input type="radio" name="group4" wicket:id="g4b3"><\td>
</tr>
<tr>
<td><input type="radio" name="group1" wicket:id="g1b4"><\td>
<td><input type="radio" name="group2" wicket:id="g2b4"><\td>
<td><input type="radio" name="group3" wicket:id="g3b4"><\td>
<td><input type="radio" name="group4" wicket:id="g4b4"><\td>
</tr>
</tbody>
</table>
As you see, the four groups are mixed together and if I create a group that doesn't exist in HTML, an exception is thrown.
If I declare different groups with the same wicket id, only the last radio button I add is taken into account.
Can anyone help me out?
Wrap the Radios with four nested RadioGroups, and pass the correct group instance to each Radio constructor:
final RadioGroup<Integer> radioGroup1 = new RadioGroup<Integer>("radioGroup1", new Model<Integer>());
final RadioGroup<Integer> radioGroup2 = new RadioGroup<Integer>("radioGroup2", new Model<Integer>());
final RadioGroup<Integer> radioGroup3 = new RadioGroup<Integer>("radioGroup3", new Model<Integer>());
final RadioGroup<Integer> radioGroup4 = new RadioGroup<Integer>("radioGroup4", new Model<Integer>());
add(new FeedbackPanel("feedback"));
add(new Form<Void>("form")
.add(radioGroup1
.add(radioGroup2
.add(radioGroup3
.add(radioGroup4
.add(new Loop("loop", 10) {
#Override
protected void populateItem(LoopItem item) {
Model<Integer> itemModel = Model.of(item.getIndex());
item.add(new Radio<Integer>("radio1", itemModel, radioGroup1));
item.add(new Radio<Integer>("radio2", itemModel, radioGroup2));
item.add(new Radio<Integer>("radio3", itemModel, radioGroup3));
item.add(new Radio<Integer>("radio4", itemModel, radioGroup4));
item.add(new Label("label", itemModel));
}
})))))
.add(new Button("submit") {
#Override
public void onSubmit() {
info(Strings.join(", ",
radioGroup1.getModelObject().toString(),
radioGroup2.getModelObject().toString(),
radioGroup3.getModelObject().toString(),
radioGroup4.getModelObject().toString()));
}
}));
<div wicket:id="feedback"></div>
<form wicket:id="form">
<div wicket:id="radioGroup1">
<div wicket:id="radioGroup2">
<div wicket:id="radioGroup3">
<div wicket:id="radioGroup4">
<table>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
</tr>
<tr wicket:id="loop">
<td><input type="radio" wicket:id="radio1"></td>
<td><input type="radio" wicket:id="radio2"></td>
<td><input type="radio" wicket:id="radio3"></td>
<td><input type="radio" wicket:id="radio4"></td>
<td><span wicket:id="label"></span></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<button wicket:id="submit" type="submit">Submit</button>
</form>
I think you could the RadioGroup tag wrapping the table (or even the tbody tag). A wicket:container tag won't mess with the HTML structure. Like this:
<wicket:container wicket:id="group">
<table id="table1">
<!-- The rest of the table markup -->
</table>
</wicket:container>