• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I use array of beans of length greater that 500 suppose?

 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody, I am Chaitanya, I am having a doubt regarding how to transfer data from server to client.

I am having a table which consists subject names and codes. At most there can be 500 records in that table.

I have an equivalent bean which has the getter and setter methods.

I need to send the entire details to the client so that he can select any subject. This is my requirement. Can I go with beans?

Or is there any other alternative?

Thank you all in advance. Have a good day.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course; why couldn't you?

(That said, giving the user a web page with 500 options on it is a poor user experience--I'd consider some sort of paging mechanism.)
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mr. David, can you please tell me what is meant by paging mechanism. Actually I need to generate a jsp which consists of some options and a drop down list. The user must select an option from the drop down list. The options in the list are in the database table. There can be at most 500 options. This is the thing.

Can you please tell me how to do? Thank you in advance.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mr. David, kindly can you please tell me how to address this requirement. I stopped my coding here and looking or a best alternative.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like what you need is what is called an "autocompleter" or "suggest" control. And before you ask, just google those terms.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am confused Mr. Bear with paging, autocompleter, i dont know what those are.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And googling didn't help at all?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:And before you ask, just google those terms.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I referred here. Already I am confused, this page confused me again.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this page. Play with the example.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my actual requirement. There is a user(student) who has to select his course subjects form the given list. The subjects list is in a database table. So I am sending a request to a servlet and that servlet calls a model and retrieves the data and submits to the servlet, then the servlet sets an attribute and sends it to the view(jsp) from where the user will select his course subject. This is what I have to do.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear I dont want a suggest box, I want a combobox in which the list is already populated. Can I use array of beans, is it a best approach?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no such thing as a "combo box" on the web. Please read this: HtmlHasNoComboBox

So you really want an unusable dropdown control with 500 entries? Really? I mean, really?

And if that's the case what is your confusion? You deal with a collection of 500 element in the same exact manner as a collection of 2 elements.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I said combo box, its a dropdown box.

I was asking that, can I go for bean length of 500, that was my question. I thought that it is a false idea. Now it is clear. Thank you Mr. Bear. I ll go with beans.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A dropdown box with 500 elements is completely unusable.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unusable means? I did not get you Mr. David. Can you please tell me?
 
Albareto McKenzie
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chaitanya karthikk wrote:Unusable means? I did not get you Mr. David. Can you please tell me?


Unusable means that anyone who sees a select box with 500 elements will run away from the application.
 
chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see. Ok, I agree with all of you and thanks for making me understand. I will go with suggest controls. Thank you all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!