keinloffel
Programmer
I have a JSP page in which I have:
o One drop down box (Uses SELECT) - Called WorkType
o One Text Field. - Called Description
I also have a JavaBean in which I have instance variables for both WorkType and Description.
Every Time I change the worktype, the page refreshes. The problem I am facing is that I am not able to store what is entered into the description box so that after I refresh, the same description turns up again.
So, if i choose worktype1 and enter in the description: haha
Then if i change the worktype to worktype2, the page refreshes with
worktype = worktype2
description = blank
For every refresh I am able to store what worktype i have, in the bean. This is made much easier by the fact that it uses the SELECT keyword.
<OPTION SELECTED VALUE="<%= workTypes[x][0] %>" > <%= workTypes[x][1] %> </OPTION>
<% sb.setWorkType( workTypes[x][0] ); %>
<% } else { %>
<OPTION VALUE="<%= workTypes[x][0] %>"> <%= workTypes[x][1] %> </OPTION>
the setWorkType does the saving for me.
My problem is that I cannot do the same for description, so that the page remembers what the user wrote, EVEN IF they didnt hit submit. If they had hit submit, i would easily have used request.getParameter and got the description. But here the problem is the user never saves the description at all.
Here's the description line i have so far:
<TD class="main1"><b>Description</b><br><TEXTAREA ROWS=1 COLS=30 NAME="description" ><%= sb.stripTilde(loadDescription) %></TEXTAREA></TD>
<% } %>
I need to be able to somehow say, sb.setDescription like i did for worktype. But I cant pull out whats entered in the box.
Any suggestions???
Thanks!!!!!!
o One drop down box (Uses SELECT) - Called WorkType
o One Text Field. - Called Description
I also have a JavaBean in which I have instance variables for both WorkType and Description.
Every Time I change the worktype, the page refreshes. The problem I am facing is that I am not able to store what is entered into the description box so that after I refresh, the same description turns up again.
So, if i choose worktype1 and enter in the description: haha
Then if i change the worktype to worktype2, the page refreshes with
worktype = worktype2
description = blank
For every refresh I am able to store what worktype i have, in the bean. This is made much easier by the fact that it uses the SELECT keyword.
<OPTION SELECTED VALUE="<%= workTypes[x][0] %>" > <%= workTypes[x][1] %> </OPTION>
<% sb.setWorkType( workTypes[x][0] ); %>
<% } else { %>
<OPTION VALUE="<%= workTypes[x][0] %>"> <%= workTypes[x][1] %> </OPTION>
the setWorkType does the saving for me.
My problem is that I cannot do the same for description, so that the page remembers what the user wrote, EVEN IF they didnt hit submit. If they had hit submit, i would easily have used request.getParameter and got the description. But here the problem is the user never saves the description at all.
Here's the description line i have so far:
<TD class="main1"><b>Description</b><br><TEXTAREA ROWS=1 COLS=30 NAME="description" ><%= sb.stripTilde(loadDescription) %></TEXTAREA></TD>
<% } %>
I need to be able to somehow say, sb.setDescription like i did for worktype. But I cant pull out whats entered in the box.
Any suggestions???
Thanks!!!!!!