• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting the attribute of a tag dynamically.  RSS feed

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • 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 ]
 
Patel Chintan
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • 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.
 
Aditya Keyal
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!