• 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

Setting the attribute of a tag dynamically.

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

I have a custom tag which will list formId and form code from database based on the module id.

now i have a list in which user select module id. and on change the value of the form id and form code should be changed in the list box.

there are two list boxes in the jsp

left one display the unassigned forms and right one displays the assigned form ?

but now how do i set the attribute value of a tag dynamically onChange event of a list ? and onChange event of list i also need to refresh the assigned and unassigned form listbox.

how do i do that ? what are the alternative i have ?

[ December 01, 2008: Message edited by: Jigar Naik ]
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jigar Naik:
Hi,

I have a custom tag which will list formId and form code from database based on the module id.

now i have a list in which user select module id. and on change the value of the form id and form code should be changed in the list box.

there are two list boxes in the jsp

left one display the unassigned forms and right one displays the assigned form ?

but now how do i set the attribute value of a tag dynamically onChange event of a list ? and onChange event of list i also need to refresh the assigned and unassigned form listbox.

how do i do that ? what are the alternative i have ?


[ December 01, 2008: Message edited by: Jigar Naik ]



Ajax can help you in this problem, you can make ajax call to your server on change of dropdown. And fetch params according to selection criteria.
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your custom tag is in a jsp(server) where as the javascript is in the HTML(client). What you need to do is go back to the server and render back the jsp with the changed values of the id and code. This can be done by either Ajax (which is neater since only a part of your response would be send) or you can actually send the entire request and re render the entire page.

--------------
Aditya
reply
    Bookmark Topic Watch Topic
  • New Topic