java - How to add input form (feedback) in DSpace with really long data? -


I can get it this way:
  select country = form.addItem (). AddSelect ("Country"); UserType.setLabel ("Country"); UserType.addOption ("", "Please select your country"); UserType.addOption ("ABW", "Aruba"); UserType.addOption ("AFG", "Afghanistan"); & Lt; ----- A from Z --- and the rest of the rest of the country; UserType.setOptionSelected (parameters.getParameter ("country", "")); Textaria Country Other = Form.ADITIM (). AddTextArea ("Country Other"); Country Other Set val (parameter japiramator ("country other", ""));   

I want to tighten the code with a really long list of countries. Is there any alternative for this to keep a list of countries in a different place and to pull this information? Thanks in advance.

One simple method is to create a config file: config / modules / Countries.cfg and configuration properties:

  ABW = Aruba AFG = Afghanistan ...   

Then add them to your Select Configuration Manager

  Select Country = form.addItem (). AddSelect ("Country"); Country.setLabel ("country"); Country.addOption ("", "Please select your country"); Enumeration & lt ;? & Gt; Countries = Configuration Manager Property Name ("Country"); While (countries haveMoreElements ()) {string key = (string) countries.nextElement (); String Value = Configuration Manager Metaprotti ("country", key); Country.addOption (key, value); }    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -