Padding columns that hold data from bean/vector
843835Jul 19 2002 — edited Jul 29 2002I am relatively new to JSP, but attempting to use it in anger.
I have written an application in JSP and JAVA that has a number of search buttons that open a window that calls a further JSP. This jsp
has a vector of data that needs to be displayed in a SELECT tag.
On double clicking I want the row selected to be returned to the first JSP to be stored in 2 fields - namely an ID and NAME field.
However, I have 2 issues:
1.) The data is displayed in a non-padded format - that is I am selecing
an ID and a NAME and it comes out as follows:
100 Brown
100001 Smith
10200110 Jones
1 Ahmed
What I would like to do is to display the data in the following format:
100 Brown
100001 Smith
10200110 Jones
1 Ahmed
So how I do this.
The data is displayed a via a SELECT tag - example code below
<option value=<%=personV.getPersonID() %>> <%=personV.getPersonID() %><%= " "%><%=personV.getPersonLastName() %></option>
2. How do I get the data back to the calling JSP. I have used the DOM
model for another list, but found I could only get the
description copied into the field and not the code into its field -
in this instance I had a code and a description in a SELECT tag
list ?