• 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

logic:iterate issue

 
Ranch Hand
Posts: 63
Spring Java Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a logic iterate to display all elements of a list. When i click the row, all the table columns should become amendable i.e., the text present at the table columns should become editable like text boxes. Can anyone suggest the logic. I tried in the following way.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You will have to write some serious JavaScript to accomplish what you want. Personally, I prefer to have "Edit - Delete" links on each line item and bring up another page to do the editing.
 
Radhakrishna Sharma Gorenta
Ranch Hand
Posts: 63
Spring Java Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joe,
Thank you for reply..
I have some number of rows and i have to make all the fields as amendable(should become editable in textbox) of a particular row when i supposed to click on that particular row.
Can you please give a snippet of code for that.
 
Greenhorn
Posts: 9
Eclipse IDE Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
with <bean:write name....> you're just displaying the field value. If you want it to be editable (i.e. be able to modifiy its value) you have to display it in an HTML element <input type=text ....>

so your code should be in Struts 1.x :

I made the assumption, you've chosen html as a prfix for struts tags with a line like:

And of course you have to encapsulate the whole display in a form whose action would take care of taking into account the modifications (saving to database, ...)

You might want to have a look at this example.

Regards
Franck
 
Radhakrishna Sharma Gorenta
Ranch Hand
Posts: 63
Spring Java Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Franck,
Thank you very much for your valuable reply.
Here i just put a part of my code. I don't have any problem in accessing Struts. The fields should be displayed first in a web page(using bean:write) and then when i click a row the fields should become as editable as per the requirement.
Can you please suggest the way to do it.
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

rk sharma wrote:
Can you please suggest the way to do it.



As I said before, you will have to write some JavaScript to accomplish this task. Here is an example that shows how to display and hide fields depending on an action. If you are familiar with JavaScript, you should be able to adapt it (if you are not familiar with JavaScript, you'll need to do some reading to get up to speed).
Since this task has little to do with Struts, I suggest you have a look at our JavaScript forum.
 
reply
    Bookmark Topic Watch Topic
  • New Topic