• 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

Question on RELOAD of JSP page AFTER facesMessage fixed

 
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JSP page whereby when the user clicks the submit button I validate the input texts and the values selected from dropdown boxes. Also, I have 2 dropdown boxes whereby I default the values and then DISABLE the dropdown box so that no entries can be changed in those dropdown boxes. The issue is after the fix is made the DROPDOWN BOXES are enabled again and the values are changed to their default values.

The DISABLE of the dropdown boxes is done by JQuery based on values entered in input fields.

Is there a way that after the facesMessage is fixed and the page is realoded that the values in the dropdowns are maintained and the DISABLED attribute is maintained as well on the JSP page?

Any suggestion/direction would be appreciated.

Thanks.
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why the values of the dropdown boxes change to their default values? Have you checked if this behavior occurs even id you do not disable them? If I remember correctly disabled inputs DO NOT send their data to server. So your logic is faulty there. Have you tried readonly (instead of disabled) or similar?

As for how to disable input after the reload I have done something similar (not with JQuery though) and I just do what I have to do (with javascript) when the page has been loaded. I know that it is not a perfect solution but it works in my particular needs.
Something like this:

(where the init() is a javascript funtion that can for example disable those dropdown boxes after the reload etc.)
 
The moustache of a titan! The ad of a flea:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic