Changeset 1493


Ignore:
Timestamp:
Dec 2, 2011, 2:56:39 PM (10 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #344: Exception when trying to register more than one specimen tube for a case

The root of the problem seems to be that box information (eg. the id) is not loaded until the "Box" field in question is losing the input focus. If we never step through that field the wizard will later on (when "Column" field loses focus) try to check well information. This check fails since the box id is not loaded.

This fix consists of three parts:

  • If a recent box has been used and it has free wells, it's id is used for the boxes
  • If the 'suggest' link is used, the id is updated using data from the result of the suggestion
  • Otherwise, we simulate a 'losing focus' event on the "Box" field (eg. we call 'boxOnChange').
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/branches/2.0-stable/resources/specimentube.jsp

    r1460 r1493  
    2727  BioPlate recentBox = null;
    2828  String recentBoxName = ""; 
     29  int recentBoxId = 0;
    2930  if (recentBoxes.size() > 0)
    3031  {
     
    4445          nameString = "0"+nameString;
    4546        }
    46         recentBoxName = "Sp"+nameString;       
     47        recentBoxName = "Sp"+nameString;
    4748      }     
    4849    }
     
    5051    {
    5152      recentBoxName = recentBox.getName();
     53      recentBoxId = recentBox.getId();
    5254    }
    5355  }
     
    190192    var allPrepWeightValue = '';
    191193
    192     boxInfo[i] = null;
     194    boxInfo[i] = <%=recentBoxId == 0 ? "null" : recentBoxId %>;
    193195    var boxDisabled = '';
    194196   
     
    426428    setInputStatus('rowColumn'+tubeIndex, 'Row or column cannot be empty when the box is specified.', 'invalid');
    427429    return false;
    428   }
     430  }
     431 
     432  if (boxInfo[tubeIndex] == null)
     433  {
     434    boxOnChange(tubeIndex);
     435    if (boxInfo[tubeIndex] == null) return;
     436  }
    429437 
    430438  var request = Ajax.getXmlHttpRequest();
     
    506514    if (response.boxInfo)
    507515    {
     516      boxInfo[tubeIndex] = response.boxInfo;
    508517      if (response.freeRow && response.freeColumn)
    509518      {
Note: See TracChangeset for help on using the changeset viewer.