Changeset 4568


Ignore:
Timestamp:
Oct 7, 2008, 3:54:47 PM (14 years ago)
Author:
Martin Svensson
Message:

Fixes #1105 Automatically set "array design" on raw bioassay that has link via scan->hyb->...->array design

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/src/docbook/userdoc/rawbioassays.xml

    r4509 r4568  
    189189        <listitem>
    190190          <para>
    191             The scan this raw bioassay is related to (optional).
     191            The scan this raw bioassay is related to (optional). Changing this property will
     192            also update the value in <guilabel>Array design</guilabel>, but only if the
     193            selected scan is connected to an array design and the current user has permission
     194            to view it.
    192195          </para>
    193196        </listitem>
  • trunk/www/views/rawbioassays/edit_rawbioassay.jsp

    r4511 r4568  
    289289  <%@page import="net.sf.basedb.core.Include"%>
    290290<base:page type="popup" title="<%=title%>">
    291   <base:head scripts="tabcontrol.js,annotations.js,platforms.js" styles="tabcontrol.css">
     291  <base:head scripts="tabcontrol.js,annotations.js,platforms.js,ajax.js" styles="tabcontrol.css">
    292292    <script language="JavaScript">
    293293    // Validate the "RawBioAssay" tab
     
    464464    function scanOnChange()
    465465    {
     466      var frm = document.forms['rawbioassay'];
     467      var selectedIndex = frm.scan_id.selectedIndex
     468      var scanId = frm.scan_id[selectedIndex].value;
     469      if (scanId > 0) updateArrayDesign(scanId);
    466470      parentsChanged = true;
    467471    }
     
    488492      list[1].text = name;
    489493      list.selectedIndex = 1;
     494      updateArrayDesign(id)
    490495      parentsChanged = true;
    491496    }
     
    564569      parentsChanged = true;
    565570      arrayDesignOnChange();
     571    }
     572    function updateArrayDesign(scanId)
     573    {
     574      var request = Ajax.getXmlHttpRequest();
     575      if (request != null)
     576      {
     577        var url = '../scans/ajax.jsp?ID=<%=ID%>&cmd=GetArrayDesign&item_id=' + scanId;
     578        request.open("GET", url, true);
     579        Ajax.setReadyStateHandler(request, updateArrayDesignCallback);
     580        request.send(null);
     581      }
     582      return request != null;
     583    }
     584    function updateArrayDesignCallback(request)
     585    {
     586      var frm = document.forms['rawbioassay'];
     587      var response = Main.trimString(request.responseText).split(':');
     588      if (response[0] > 0)
     589      {
     590        var designId = response[0];
     591        var designName = response[1];
     592        var designList = frm.arraydesign_id;
     593        if (designList.length < 2 || designList[1].value == '0') // >
     594        {
     595          Forms.addListOption(designList, 1, new Option());
     596        }
     597        designList[1].value = designId;
     598        designList[1].text = designName;
     599        designList.selectedIndex = 1;
     600      }
    566601    }
    567602   
     
    732767            newitem="<%=rawBioAssay == null%>"
    733768            onselect="selectScanOnClick()"
     769            onchange="scanOnChange()"
    734770          />
    735771        </td>
Note: See TracChangeset for help on using the changeset viewer.