jeudi 1 janvier 2015

Displaying Data on Table


I have a question.I have an empty <table> and when i click on an empty <td>-Element, i can pass Data from an <input>-Element and save this String into my Database.Actually i want this String to be displayed on my <td>-Element.(It means,there is a possibity, that every <td>-Elements can display its own String.)


This is how i create my <table> :



<tbody>
<%for(int uzeit = 0; uzeit < uhrzeit.length ;uzeit++) { %>
<tr>
<td><%out.println(uhrzeit[uzeit]); %></td>
<%for(int rest =0; rest<wochentag.length;rest++) { %>
<td class="td_test"></td>
<%} %>
</tr>
<%} %>
</tbody>


This is how i save the <input> :



int result = 0;

if(request.getParameter("submit") != null) {
String name = new String();

if(request.getParameter("getdata") != null) {
name = request.getParameter("getdata");
}else {
out.println("termin is null");
}
Termin t1 = new Termin();
result = t1.setTermin(name);

setTermin(name) adds ’name’ to my Database.


Hope someone can help me :)





Aucun commentaire:

Enregistrer un commentaire