Hi Larry

I implemented a home-brewed (hack) auto complete for the spatial 
coverage field for our repository.

I added the following to the <xsl:template match="dri:field" 
mode="normalField"> template to add the hidden popup divs to the dom:

<xsl:if test="@n='dc_coverage_spatial'">
<xsl:attribute name = "autocomplete">off</xsl:attribute>
<div class="shadow" id="shadow">
<div class="output" id="output">
some text
</div>
</div>
<xsl:attribute name="a"><xsl:value-of select="@n"/></xsl:attribute>
</xsl:if>

Add autocomplete javascript, see 
http://datashare.edina.ac.uk/dspace/themes/DataShare/auto-complete.js
Add an init call to the onload

<body onload="init()">

Modify the css to align the pop up.

.output
{
    font-family:Arial;
    font-size: 10pt;
    color:black;
    padding-left: 3px;
    padding-top: 3px;
    border: 1px solid #000000;
    width: 180px;
    background: #fff;
}

.shadow
{
    width: 182px;
    position: relative;
    margin-left: -57px;
    margin-top: -8px;
    top: 2px;
    left: 2px;
    background: #555;
}

.shadow div
{
    position: relative;
    top: -2px;
    left: -2px;
}


I think that's it. The javascript is based on something I found the web, 
this URL shows it in action:

http://www.vonloesch.de/node/18

George


Larry Stone wrote:
> Has anyone tried to add an "autocomplete" feature to the Manakin UI  
> (XMLUI)?  By "autocomplete", I mean the Web UI trick where a text  
> field is checked, as you type, against a list of possible completions  
> and automatically filled in, or completed, by inserting text into the  
> field or posting a dropdown menu of possible completions.  For  
> example, the AjaxTags library has it under "Autocomplete", see 
> http://ajaxtags.sourceforge.net/ 
>   -- but that's specifically for a JSP-based UI.
>
> Autocomplete usually seems to be implemented as part of a  
> comprehensive Javascript UI toolkit, and most of those are large,  
> complex, standalone, and/or do not play well when integrated with  
> another vertical-web-UI-solution like Cocoon.  So, do you know of any  
> such toolkit that _is_ easy to integrate with Cocoon and/or Manakin?   
> Has anyone developed their own autocomplete?
>
> I've been experimenting with the Yahoo UI widgets 
> (http://developer.yahoo.com/yui/ 
> ); it's well-documented and seems reasonably lightweight and modular,  
> but it has some drawbacks. I'm hoping there is somebody already at the  
> top of this learning curve who can see over this swamp from such a  
> lofty vantage.
>
> thanks,
>
>    -- Larry
>
> ------------------------------------------------------------------------------
> OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
> looking to deploy the next generation of Solaris that includes the latest 
> innovations from Sun and the OpenSource community. Download a copy and 
> enjoy capabilities such as Networking, Storage and Virtualization. 
> Go to: http://p.sf.net/sfu/opensolaris-get
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>
>
>   


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to