• 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

Problem while modifying the value of a property inside a bean

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a jsp which looks like the following



I have form bean named as MainSearchForm.java containing a property

retryAction which is a bolean property.

======================
treeFolderFooter.inc
======================

The above inlude file calls a javascript function which has the following code in it

var actionValue = document.getElementsByName("MainSearchForm.retryAction")[0];
actionValue.value='true';
}} [/CODE]

However trying this I find the bean value doesn't get changed at all.

Can anyone help me out pls ? Thanks in advance.

Cheers
Anirban
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Anirban Das:
I have form bean named as MainSearchForm.java containing a property retryAction which is a bolean property.


JavaScript doesn't operate on Java classes or properties which exist only on the server. JavaScript runs on the browser and operates only on HTML elements. Do you have an HTML element with the name "MainSearchForm.retryAction"? If not, that's why your code isn't working.

If you're not sure if you have an element with that name, use your browser's view source fuction to see the raw HTML and see if you can find name="MainSearchForm.retryAction" anywhere.
 
Anirban Das
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Merill. You were right. Its working fine now.


cheers
Anirban
 
Whatever you say buddy! And I believe this tiny ad too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic