Win a copy of Head First Android this week in the Android forum!
  • 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

Help with the Dynamic Attribute API.

Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I want to set up dynamic attributes (and also the optionlist) for some of the <select> dropdowns on one of my site's search page.
Here are the steps that I followed:

1) My Tag Handler class implements the DynamicAttributes.
2) I then overrode the setDynamicAttributes(String uri, String name, Object value) which stores the attribute names and values in a locally declared Hashmap
3) In doTag() method, I retrieved the set of attributes from the Hashmap and generated the dropdowns.
4) I, then configured the 'required' attributes in the TLD and these have setter methods in my tag handler class and I also set the <dynamic-attributes> element to true.

I have 3 questions.

1) I have a total of 6 dropdowns on the page and I want onchange attribute (and a few more) to be added to those. How and where should I call the setDynamicAttributes() attributes method?
2) The optionlist for each of those dropdowns comes up from the DB can you propose any generic code/idea that (it has to be reusable) I can use to fill up the optionlist attribute for the 6 dropdowns? And this code goes in the setter method for optionlist, correct?
3) setDynamicAttributes(String uri, String name, Object value) - I did not understand the purpose of the URI parameter here. Does it denote an XML/XSI namespace or something of that sort?

    Bookmark Topic Watch Topic
  • New Topic