Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

I only want one instance  RSS feed

Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the situation before I inherited the project: There was an applet with a browse button. There was also another button that was not part of the applet. Clicking on the button launched a process with the selected path as a parameter.

Here's the situation now: I added a set of radio buttons to the applet. Selecting a radio button populates a variable with the selection. However, I have discovered that clicking on the button now launches another instance of the applet, so that the radio selection is not preserved.

What is the best and shortest way to preserve the value of the original selection?
Posts: 3323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

If you want values to persist when the page refreshes then you need to keep a record of the values whenever they are changed and read in these recorded values when the new applet instance loads. You may want to keep record the current date and time as well so you don't load out of date values eg from a session several hours/days ago.

I've never done this before but I think you could do it with cookies. There's a thread here that may get you started.
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!