?
Solved

how to handle a "grid" type of interface data access on the web

Posted on 2003-03-18
9
Medium Priority
?
190 Views
Last Modified: 2010-04-01
Dear experts,

I have a web application which has a page with "grid" style of data entry form. However, this is a 15X25 grid, which means there are 375 squares for people to enter their data(number). I am not sure how should I handle this type of data entry since it is impossible to name them all differently. On the other hand, at the database side, I only create one column for this field.

Any input?
Thanks.
0
Comment
Question by:changcy77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 14

Expert Comment

by:kennethxu
ID: 8159637
in this case, you can give all those grid the same name for example, keeping repeating this 375 times in the page:

<input type="text" name="fieldname">

when submit, just use
String[] fields = request.getParameters( "fieldname" );
now you have fields as an array of 375 strings.


HTH
0
 

Author Comment

by:changcy77
ID: 8160212
Thanks. In fact, I think it should be request.getParameterValues(field). You are very close.:)

By the way, do you know if we can use JavaBean tag to set property of an array filed? I mean if there is a field of the JavaBean--
String [] test;

Will setProperty set the value for us? I will reward points to expert who has the answer. Thanks.
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8161504
>> In fact, I think it should be request.getParameterValues(field)
you are right! I just used IDE's autofinish too much, tend to forget exact method name. sorry about that.

I use:

<jsp:setProperty name="beanName" property="propertyName" value='<%=request.getParameterValues("fieldname" )%>'/>
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Accepted Solution

by:
kennethxu earned 150 total points
ID: 8162964
you can still use
<jsp:setProperty name="bean" property="names"/>
or
<jsp:setProperty name="bean" property="names" param="frmName"/>

as long as you define your bean correctly:

public class SimpleBean {
    private String[] names = null;
    public void setNames( String[] names ) { this.names = names; }
    public String[] getNames() { return names; }
}
0
 

Author Comment

by:changcy77
ID: 8174078
Thanks, HTH.

I also wonder if there is a good way to populate the data into grid after retrieved from database. Since it might be a long process... do you know if JSP has any caching ability? Or other solution people might suggest?

0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8174937
>> do you know if JSP has any caching ability?
1. some web server and/or servlet container provide page caching.
2. for http 1.1 container and client. you can implement HttpServlet.getLastModified(HttpServletRequest req). to tell the browser there is no change after returned time.

>> Since it might be a long process
if you mean it take long time to retrive data from database, you can store result in a list or map, and save it in session or context scope.

but, please note that all those caching can be done only when data in database is quite static.
0
 

Author Comment

by:changcy77
ID: 8181890
thanks.
but, since every query could be quite different, the result won't be the same, therefor, save it some where in the session, probably won't fit my case.

i am trying to concatenate all the strings of the array into one long string, which stored in the database. after retrieve from database, i use StringTokenizer to populate the grid one cell at the time-- which i think is slow. any other way? Thanks.
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8182241
you said every query is different and then save it in database, I don't see what's the different between same in db and save in session. actaully i don't quite sure what exactly you want to achieve.
do you know where is the bottleneck of your application?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question