Continuo ad avere dei problemi, fondamentalmente non capisco cosa devo fare.
Qui sotto posto il codice della pagina.
In pratica ho bisogno che le 2 textarea di nome "descrizione" e "commentocliente" facciano un refresh leggendo da un bean nel context 2 campi che vengono scritti da 2 servlet relative a 2 form presenti su un'altra pagina. La scrittura sul bean avviene regolarmente.
Non voglio che mi scriviate il codice, ma almeno datemi un'idea su come muovermi perché ci sto provando ma non ne vengo a capo.
Codice PHP:<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*" %>
<%@page import="bean.PropostaRicettaBean" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Valuta Proposta</title>
</head>
<% String ruolo = (String)session.getAttribute("ruolo");
application = getServletContext();
PropostaRicettaBean ricetta = (PropostaRicettaBean)application.getAttribute("ricetta");
List listadattesa = (List)application.getAttribute("listadattesa");
int lista = listadattesa.size() - 1;
String abbandonata = (String)application.getAttribute("abbandonata_proposta");
%>
<script type="text/javascript">
<!--//
// funzione per prendere un elemento con id univoco
function prendiElementoDaId(id_elemento) {
var elemento;
if(document.getElementById)
elemento = document.getElementById(id_elemento);
else
elemento = document.all[id_elemento];
return elemento;
};
//-->
</script>
<body>
<%if (session.getAttribute("username") == null) { %>
<jsp:forward page ="homepage.jsp"/>
<%}
else {
if (abbandonata.equals("si")) {
application.setAttribute("abbandonata_proposta", "no");
String redirectURL = "hpchef.jsp";
response.sendRedirect(redirectURL);
} else {%>
<center>
<h2>Valuta Proposta</h2>
<%if (lista <= 0) {%>Non ci sono clienti in attesa.<%} else if (lista == 1) { %>
C'è <%=lista %> cliente in attesa</p><%} else { %>
Ci sono <%=lista %> clienti in attesa</p><%} %>
<table>
<tr>
<td rowspan="2">
<table border="1">
<tr height="20">
<td>Ricetta Proposta</td>
</tr>
<tr>
<td><textarea name="descrizione" readonly rows="17" cols="30"></textarea></td>
</tr>
</table>
</td>
<td width="5">
</td>
<td>
<table border="1">
<tr height="20">
<td>Commenti del Cliente</td>
</tr>
<tr>
<td><textarea name="commentocliente" readonly rows="5" cols="30"></textarea></td>
</tr>
</table>
<form name="formcommentochef" action="InvioCommentoChef" method="get">
<table border="1">
<tr height="20">
<td>Scrivi qui i tuoi commenti</td>
</tr>
<tr>
<td><textarea name="commentochef" rows="5" cols="30"></textarea></td>
</tr>
</table>
<input type="submit" value="Invia Commenti" name="submit">
</form>
</td>
<td>
<form name="accettaricetta" action="ApprovaRicetta" method="post">
<input type="submit" value="Approva la Ricetta" name="submit">
</form>
<form name="rifiutaricetta" action="RifiutaRicetta" method="post">
<input type="submit" value=" Rifiuta la Ricetta" name="submit">
</form>
<table border="1">
<tr>
<td>Tipo di Portata</td>
<td><select name="tipoportata" id="tipoportata">
<option value="">-Da selezionare-</option>
<option value="primo">Primo</option>
<option value="secondo">Secondo</option>
<option value="dolce">Dolce</option>
</select>
</td>
</tr>
<tr>
<td>Ingredienti Principale</td>
<td><input type="text" name="ingrediente1"><input type="text" name="ingrediente2"><input type="text" name="ingrediente3">
</td>
</tr>
</table>
<input type="submit" value="Cerca" name="submit">
</tr>
</table>
[url="ricettario.jsp"]Ricettario[/url]
[url="hp<%=ruolo %>.jsp"]Home Page[/url]
</center>
<%}
} %>
</body>
</html>

Rispondi quotando