Skip to content

Commit

Permalink
WildMeOrg#282 Null or empty string handling for viewpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishanth Nattoji committed May 1, 2024
1 parent 6500498 commit f35b6b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/webapp/encounters/manualAnnotation.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ myShepherd.beginDBTransaction();
try{
String vlist = "<p> 1. Select viewpoint: <select name=\"viewpoint\" class=\"notranslate\" onChange=\"return pulldownUpdate(this);\"><option value=\"\">CHOOSE</option>";
final String noViewpoint = "----------";
vlist += "<option" + (noViewpoint.equals(viewpoint) ? " selected" : "") + ">" + noViewpoint + "</option>";
vlist += "<option value=\"\"" + (viewpoint == null || viewpoint.equals("") ? " selected" : "") + ">" + noViewpoint + "</option>";
final Set<String> results = new LinkedHashSet<>(Annotation.getAllValidViewpoints());
Iterator it = results.iterator();
while (it.hasNext()) {
Expand Down Expand Up @@ -354,7 +354,7 @@ try{
function pulldownUpdate(el) {
//console.info('%o', el.name);
var u = window.location.href;
var m = u.match(new RegExp(el.name + '=\\w+'));
var m = u.match(new RegExp(el.name + '=\\w*'));
if (!m) { //was not (yet) in url
u += '&' + el.name + '=' + encodeURIComponent(el.value);
} else {
Expand Down

0 comments on commit f35b6b2

Please sign in to comment.