• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to do readonly lists in jsp

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey guys,
I want to do read only my lists in the JSP after sending data to the action class.I'm using struts2 as the framework.so if there is a way to do read only lists after clicking submit button please inform.
 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so you want to do read-only list after submitting data to action and I am thinking you're referring to the JSP after your action return "SUCCESS"

so you pushing a list onto ValueStack and you want this list to be read-only? is that correct?

if your JSP is just displaying the list and not doing anything besides displaying the list, isn't that itself "read-only"?

It's hard to answer your question when you're not giving more descriptions of what your action is doing and include some actual code
 
Gihan Pandigamage
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK this is the scenario. I have a jsp page which use to edit records in the database.and also there are search and edit buttons to retrieve and edit data in the data base.
first I select a value from the drop down list and also give relevant values to text fields as search key words.then click the search button.after retrieve a record from the data base I want to edit the retrieved record but the value in the drop down list is a primary key of the database table.so I want to do read only the drop down list after retrieving the record.
that's all
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I'm missing something fundamental. A drop-down list is a UI element - it and its content are not in any way "editable". So what do you mean by "editing a drop-down list"?

As an aside, you should never present raw DB key values in the UI, either hidden or out in the open. Especially if you then send them to the server you need to encrypt them, lest the client changes the values maliciously.
 
Gihan Pandigamage
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no no I don't need to edit the drop down list.see the attached image then you can get a clear idea.

I'm using same UI to retrieve data and edit that data. so the list is the primary key of that particular database table.I want to do read only the list after getting data to the fields.then user can edit data fields but not the list that means primary key.
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't you achieve this by making those two dropdown's read only?
 
Gihan Pandigamage
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
these are two screen shots
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I still don't understand what you mean by "read-only list". In the screenshot you posted, which field is currently editable that you want to make read-only? And if you want an input field to be read-only, why make it an input field to begin with?
 
Gihan Pandigamage
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
simply I want to do read only a list after pushing a button.is there any java script or another way to do this.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's take a step back. You posted screenshots that show two lists: "Underwriter branch code" and "Risk category code". Those are UI elements, and as such can't be altered by the user. So what is the list you're talking about? How is it editable?
 
Gihan Pandigamage
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if any body knows do readonly a drop down list by clicking a button.
java script or another way
 
Gihan Pandigamage
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a drop down list. and I want to change it like a readonly field by clicking a button.(after clicking the button the list should be able to submit it's value.)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic