Changeset 2435


Ignore:
Timestamp:
11/23/09 15:58:53 (2 years ago)
Author:
erikroos
Message:

Added inline help to the AnimalDB prototype, based on Ajax technology.

When you hover with your mouse over e.g. the animal select box in the Event Manager screen, the JavaScript 'getHelpText' is called. This function calls the URL served by the InlineHelpServlet? with a parameter designating the GUI element the user put his mouse on. Furthermore, another JavaScript function (in the same .js file) is set as the event handler, once the Servlet returns its HTML. The Servlet spits out a line of text, depending on the parameter passed to it. The event handler puts the HTML from the Servlet into the help text box's InnerHTML. The event handler function has access to this box through its ID.

Location:
molgenis4animaldb
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • molgenis4animaldb/WebContent/WEB-INF/web.xml

    r2263 r2435  
    5454                <servlet-name>MolgenisServlet</servlet-name> 
    5555                <url-pattern>/download/*</url-pattern> 
    56         </servlet-mapping>       
     56        </servlet-mapping> 
     57         
     58        <servlet> 
     59                <servlet-name>InlineHelpServlet</servlet-name> 
     60                <servlet-class>servlets.InlineHelpServlet</servlet-class> 
     61        </servlet> 
     62        <servlet-mapping> 
     63                <servlet-name>InlineHelpServlet</servlet-name> 
     64                <url-pattern>/inlinehelpservlet</url-pattern> 
     65        </servlet-mapping> 
     66         
    5767</web-app> 
  • molgenis4animaldb/WebContent/res/scripts/custom/eventman.js

    r2434 r2435  
    11var xmlhttp; 
    22 
    3 function getHelptext() { 
     3function getHelptext(elementname) { 
    44        if (!xmlhttp) xmlhttp = aaGetXmlHttpRequest(); 
    55        if (!xmlhttp) return; 
    6         var url = 'helptext.html'; 
     6        var url = 'inlinehelpservlet?elname='+elementname; 
    77        xmlhttp.open('GET', url, true); 
    88        xmlhttp.onreadystatechange = printHelptext; 
     
    3232        } 
    3333} 
    34  
    35 /*window.onload=function() { 
    36         document.getElementById('animal').onmouseover=getHelptext; 
    37 };*/ 
  • molgenis4animaldb/handwritten/java/plugin/eventman/ManageEventsPlugin.ftl

    r2434 r2435  
    3232<#--begin your plugin-->         
    3333 
    34 <div style="float:left; background-color:#F7FE2E">Add event...</div> 
     34<div style="float:left"><strong>Add event...</strong></div> 
    3535<div style="float:right; background-color:#00FFFF"> 
    3636  <div id="helptextbox">Move your mouse over an element to get help.</div> 
     
    4545  <tr> 
    4646    <td rowspan=3> 
    47       <select name="animal" id="animal" size=10 onmouseover="getHelptext();" > 
     47      <select name="animal" id="animal" size=10 onmouseover="getHelptext('animal');" > 
    4848      <#if screen.selectedAnimalList?exists> 
    4949        <#list screen.selectedAnimalList as sa> 
     
    108108<td>Comment:</td> 
    109109<td> 
    110 <input type="text" size=50 name="comment" value="<#if screen.comment?exists>${screen.getComment()}</#if>" /> 
     110<input type="text" size=50 name="comment" value="<#if screen.comment?exists>${screen.getComment()}</#if>" onmouseover="getHelptext('comment');" /> 
    111111</tr><tr> 
    112112<td colspan=2> 
Note: See TracChangeset for help on using the changeset viewer.