• 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

Retaining selected values in a portlet

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have few states listed in a drop down menu in a portlet. After clicking on a state, the portlet processes the action method and displays their cities. I have linked the cities with states through SQL. However, when the city is loaded, I need the state value to remain selected. Here is my code


code from processAction method
----------------------------------------


I need to know how would I keep the state as selected after the portlet had loaded cities. I know it had got to do something with boolean flags but I really don't know how to approach the problem. Also, after iterating through cities, I need the first value of the city to be selected. Further, after clicking on a city and submitting, both city and state value should remain selected with previously selected values. Thanks in advance.
 
author
Posts: 469
20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Uday,

I would suggest that you look at actionScopedRequestAttributes container-runtime option to retain values. Also, I would recommend using something like Spring Portlet MVC and Spring form tag library to simplify developing your portlets.

regards
ashish
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic