You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gm...@apache.org on 2007/01/21 20:07:07 UTC
svn commit: r498427 -
/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/suggestajax/tablesuggestajax/resource/tableSuggest.js
Author: gmuellan
Date: Sun Jan 21 11:07:04 2007
New Revision: 498427
URL: http://svn.apache.org/viewvc?view=rev&rev=498427
Log:
Fix for issue https://issues.apache.org/jira/browse/TOMAHAWK-852
Modified:
myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/suggestajax/tablesuggestajax/resource/tableSuggest.js
Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/suggestajax/tablesuggestajax/resource/tableSuggest.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/suggestajax/tablesuggestajax/resource/tableSuggest.js?view=diff&rev=498427&r1=498426&r2=498427
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/suggestajax/tablesuggestajax/resource/tableSuggest.js (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/suggestajax/tablesuggestajax/resource/tableSuggest.js Sun Jan 21 11:07:04 2007
@@ -253,7 +253,7 @@
if(prevElem)
{
- if(prevElem.tagName == "tr")
+ if(prevElem.tagName == "TR")
{
this.putValueToField(prevElem);
this.addOutClass(this.actualHighlightedElem);
@@ -263,7 +263,7 @@
}
else
{
- var table = dojo.html.getFirstAncestorByTag(this.actualHighlightedElem,"table");
+ var table = dojo.dom.getFirstAncestorByTag(this.actualHighlightedElem,"table");
if(table)
{
@@ -424,23 +424,27 @@
//handles the user pressing the 'Down Arrow' key
org_apache_myfaces_TableSuggest.prototype.handleDownKey = function()
- {
+ {
if(!this.firstHighlightedElem)
{
- var firstOptionElem = this.getFirstRowElem(this.popUp);
+ var firstOptionElem = this.getFirstRowElem(this.popUp);
this.putValueToField(firstOptionElem);
this.addHoverClass(firstOptionElem);
this.firstHighlightedElem = firstOptionElem;
-
this.actualHighlightedElem = firstOptionElem;
}
else
{
var nextElem = dojo.dom.nextElement(this.actualHighlightedElem);
+ if(!nextElem)
+ {
+ nextElem = this.getFirstRowElem(this.popUp);
+ }
+
if(nextElem)
{
- if(nextElem.tagName == "tr")
+ if(nextElem.tagName == "TR")
{
this.putValueToField(nextElem);
this.addOutClass(this.actualHighlightedElem);
@@ -448,14 +452,14 @@
this.actualHighlightedElem = nextElem
}
}
- else
- {
- var table = dojo.html.getFirstAncestorByTag(this.actualHighlightedElem,"table");
+ /* else
+ { todo: make paginator work again
+ var table = dojo.dom.getFirstAncestorByTag(this.actualHighlightedElem,"table");
var pageField = dojo.dom.nextElement(table);
if(pageField)
{
- if(pageField.tagName == "div")
+ if(pageField.tagName == "DIV")
{
this.nextPage(pageField);
this.firstHighlightedElem = this.getFirstRowElem(this.popUp);
@@ -467,7 +471,7 @@
}
else
dojo.debug("could not move to next item in table, wrong item is");dojo.debug(nextElem);
- }
+ } */
}
}
@@ -727,7 +731,6 @@
org_apache_myfaces_TableSuggest.prototype.handleKeyDown = function(evt)
{
var keyCode = evt.keyCode;
-
switch (keyCode)
{
case 40: //down key