Win a copy of Reactive Design Patterns this week in the Functional Programming forum
or Learn Linux in a Month of Lunches in the Linux forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Show one by one elements of enum in JSP

 
Isaac Ferguson
Ranch Hand
Posts: 1044
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I would like to show one by one each element of an enumeration, in my .JSP

It is a simulation of an online shop, all the element are hard coded in en enum. I would like to have two buttons in my JSP and go next and back in the list.

I have done something like this:




That counter should represents every item from the enum, and from the . JSP when I click next increment the counter and when back decrement it.


       

Any idea, for the implementation, please?

Regards, Isaac

 
Isaac Ferguson
Ranch Hand
Posts: 1044
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using a hidden value, maybe could be a good approach...
 
Isaac Ferguson
Ranch Hand
Posts: 1044
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made it, this way



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65419
100
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this is as stuff that can be handled after the page is loaded, I would have handled it all in JavaScript.
 
Isaac Ferguson
Ranch Hand
Posts: 1044
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes in Javascript it makes more sense....I am not used to javascript, is it there any script for this? Or can it been done in Java?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65419
100
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is on the server; page manipulation happens in JavaScript. If you are going to be working on the web, you need to up your JavaScript game. And soon. The days of doing all the work on the server are coming to an end. In fact, I'd argue that they've already ended.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!