Changeset 4374


Ignore:
Timestamp:
Jul 4, 2008, 12:14:19 PM (15 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1046: Remember closed/expanded node status in the hierarchical tree of Bioassay sets

Also remembered between sessions.

Location:
trunk/www/views/experiments/bioassaysets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/views/experiments/bioassaysets/analysis_tree.jsp

    r4338 r4374  
    408408      Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
    409409    }
     410   
     411    function sendClosedWithAjax()
     412    {
     413      var request = Main.getAjaxRequest();
     414      if (request != null)
     415      {
     416        var frm = document.forms[formId];
     417        var url = '../bioassaysets/index.jsp?ID=<%=ID%>&cmd=SetClosedWithAjax';
     418        request.open("POST", url, true);
     419        var postdata = 'closed=' + frm.closed.value;
     420        request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     421        request.setRequestHeader("Content-length", postdata.length);
     422        request.setRequestHeader("Connection", "close");
     423        request.send(postdata);
     424      }
     425    }
     426   
    410427    function initTree()
    411428    {
     
    435452          frm.closed.value += menuItem.externalId+',';
    436453        }
     454        sendClosedWithAjax();
    437455        // alert(document.forms[formId].closed.value);
    438456        this.updateIconsAndText(menuItemIndex);
  • trunk/www/views/experiments/bioassaysets/index.jsp

    r3679 r4374  
    7777  {
    7878    String closed = request.getParameter("closed");
     79    if (closed == null && cc.getSetting("closed") != null && cc.getObject("closed") == null)
     80    {
     81      closed = (String)cc.getSetting("closed");
     82    }
    7983    if (closed != null)
    8084    {
     85      cc.setSetting("closed", closed);
    8186      cc.setObject("closed", new HashSet<String>(Arrays.asList(closed.split(","))));
    8287    }
     
    117122    // Display the list page without updatinging the current context
    118123    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, defaultContext, true);
     124    setClosed(request, cc);
    119125    if (transformationId != null)
    120126    {
     
    361367    redirect = "../../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&main_type=ANALYZE&title=Filter+bioassay+set&plugin_type=net.sf.basedb.core.plugin.AnalysisFilterPlugin";
    362368  }
     369  else if ("SetClosedWithAjax".equals(cmd))
     370  {
     371    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     372    setClosed(request, cc);
     373    return;
     374  }
    363375  else
    364376  {
Note: See TracChangeset for help on using the changeset viewer.