[Project_owners] Dynamic Menus and refreshing menutiems

Jawahar Swaminathan jawahar at ebi.ac.uk
Fri Jun 18 17:05:35 EDT 2004


I would appreciate some help on this topic, since I am not sure how to 

I have a toolbar with two dropdown menus. The first defines a database 
that I wish to search, and the second menupopup describes the various 
keywords that the database can be searched by. I can get different 
keywords to be added to the second menupopus by using the following code.

function generateOCA(){
  var d           = document;
  var popup       = d.getElementById('database.popup');
  var database    =d.getElementById('database');
  var p = d.createElement('menupopup');
    p.setAttribute('id', "database.popup");
    p.setAttribute('crop', "right");
  var menuitems   = new Array('Text Search', 'Keyword', 'Author', 
'Hetgroup 3 letter', 'Hetgroup Name',
                    'Header', 'Taxonomy Name', 'EC Number');
  var l           = menuitems.length;
  var newElement;
  for(var i=0; i<l; i++)
    newElement = d.createElement('menuitem');
    newElement.setAttribute('id', menuitems[i]);
    newElement.setAttribute('value', menuitems[i]);
    newElement.setAttribute('label', menuitems[i]);
  return true;

That is not a problem. The problem appears to be that once a keyword is 
selected and the database is changed, the selected keyword remains 
despite it not being in the array for that particular database.

I have tried.

p.repaint(true);  but it does not appear to work.

It would seem I need some sort of event listner or handler which 
communicates between both the dropdowns but I have no idea how.

Help appreciated.



More information about the Project_owners mailing list