Author: amarkhel
Date: 2011-01-10 11:22:03 -0500 (Mon, 10 Jan 2011)
New Revision: 20935
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
trunk/ui/output/ui/src/main/templates/menuitem.template.xml
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xmlunit.xml
Log:
https://issues.jboss.org/browse/RF-10107 Drop down menu: keyboard navigation. Tests was
updated.
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js 2011-01-10
14:57:44 UTC (rev 20934)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js 2011-01-10
16:22:03 UTC (rev 20935)
@@ -50,11 +50,11 @@
__clickHandler : function (e) {
parentMenu = this.__getParentMenu();
if (parentMenu){
- this.__getParentMenu().processItem(this.element);
- if (this.options.submitFunction){
- this.options.submitFunction.call(this,e);
- }
+ this.__getParentMenu().processItem(this.element);
}
+ if (this.options.submitFunction){
+ this.options.submitFunction.call(this,e);
+ }
},
__getParentMenu : function () {
Modified: trunk/ui/output/ui/src/main/templates/menuitem.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/menuitem.template.xml 2011-01-10 14:57:44 UTC
(rev 20934)
+++ trunk/ui/output/ui/src/main/templates/menuitem.template.xml 2011-01-10 16:22:03 UTC
(rev 20935)
@@ -17,6 +17,7 @@
<cdk:resource-dependency name="ajax.reslib"
library="org.richfaces" />
<cdk:resource-dependency name="base-component.reslib"
library="org.richfaces" />
+ <cdk:resource-dependency name="richfaces-event.js" />
<cdk:resource-dependency name="menuitem.js"
library="org.richfaces" />
</cc:interface>
@@ -75,8 +76,6 @@
</c:choose>
</c:otherwise>
</c:choose>
-
- </div>
<c:choose>
<c:when test="#{not isDisabled}">
<script type="text/javascript">
@@ -91,5 +90,7 @@
<c:otherwise>
</c:otherwise>
</c:choose>
+ </div>
+
</cc:implementation>
</cdk:root>
Modified:
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java
===================================================================
---
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java 2011-01-10
14:57:44 UTC (rev 20934)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DrowDownMenuRendererTest.java 2011-01-10
16:22:03 UTC (rev 20935)
@@ -37,7 +37,6 @@
import com.gargoylesoftware.htmlunit.html.HtmlDivision;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
-@Ignore
public class DrowDownMenuRendererTest extends RendererTestBase {
@Override
@@ -49,7 +48,7 @@
}
@Test
- public void testDoEncodeServerMode() throws IOException, SAXException {
+ public void testDoEncodeServerMode() throws IOException, SAXException {
doTest("dropDownMenu_serverMode", "form:ddmenu");
}
Modified:
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java
===================================================================
---
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java 2011-01-10
14:57:44 UTC (rev 20934)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java 2011-01-10
16:22:03 UTC (rev 20935)
@@ -37,7 +37,6 @@
import com.gargoylesoftware.htmlunit.html.HtmlDivision;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
-@Ignore
public class MenuItemRendererTest extends RendererTestBase {
@Override
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml 2011-01-10
14:57:44 UTC (rev 20934)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml 2011-01-10
16:22:03 UTC (rev 20935)
@@ -4,9 +4,9 @@
File
</div>
<div class="rf-ddm-pos">
- <div class="rf-ddm-lst" id="form:ddmenu_list"
style="display:none;min-width:250px;">
+ <div class="rf-ddm-lst" id="form:ddmenu_list"
style="display:none;min-width:250px;" tabindex="-1">
<div class="rf-ddm-lst-bg">
- <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:open"
onclick="RichFaces.ajax("form:open",event,{"incId":"1"}
);return false;" onmouseout="this.className='rf-ddm-itm
rf-ddm-itm-unsel '" onmouseover="this.className='rf-ddm-itm
rf-ddm-itm-sel '">
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:open" >
<span class="rf-ddm-itm-ic ">
<div class="rf-ddm-emptyIcon">
</div>
@@ -14,8 +14,14 @@
<span class="rf-ddm-itm-lbl ">
Open
</span>
+ <script type="text/javascript">
+//<![CDATA[
+new
RichFaces.ui.MenuItem("form:open",{"submitFunction":function(event){RichFaces.ajax("form:open",event,{"incId":"1"}
);return false;}} );
+//]]>
+ </script>
</div>
- <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:group" onmouseout="this.className='rf-ddm-itm
rf-ddm-itm-unsel'" onmouseover="this.className='rf-ddm-itm
rf-ddm-itm-sel '">
+
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:group">
<span class="rf-ddm-itm-ic ">
<div class="rf-ddm-emptyIcon">
</div>
@@ -24,27 +30,40 @@
Save As...
</span>
<div class="rf-ddm-nd">
- <div class="rf-ddm-lst rf-ddm-sublst"
id="form:group_list" style="display:none;min-width:250px;">
+ <div class="rf-ddm-lst rf-ddm-sublst"
id="form:group_list" style="display:none;min-width:250px;"
tabindex="-1">
<div class="rf-ddm-lst-bg">
- <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:save"
onclick="RichFaces.ajax("form:save",event,{"incId":"1"}
);return false;" onmouseout="this.className='rf-ddm-itm
rf-ddm-itm-unsel '" onmouseover="this.className='rf-ddm-itm
rf-ddm-itm-sel '">
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:save" >
<span class="rf-ddm-itm-ic ">
<img src="/images/ddmenu/save.gif"/>
</span>
<span class="rf-ddm-itm-lbl ">
Save
</span>
+ <script type="text/javascript">
+//<![CDATA[
+new
RichFaces.ui.MenuItem("form:save",{"submitFunction":function(event){RichFaces.ajax("form:save",event,{"incId":"1"}
);return false;}} );
+//]]>
+ </script>
</div>
+
<div class="rf-ddm-sep">
</div>
- <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:saveAll"
onclick="RichFaces.ajax("form:saveAll",event,{"incId":"1"}
);return false;" onmouseout="this.className='rf-ddm-itm
rf-ddm-itm-unsel '" onmouseover="this.className='rf-ddm-itm
rf-ddm-itm-sel '">
+
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:saveAll">
<span class="rf-ddm-itm-ic ">
<div class="rf-ddm-emptyIcon">
</div>
</span>
<span class="rf-ddm-itm-lbl ">
SaveAll
- </span>
- </div>
+ </span>
+ <script type="text/javascript">
+
+//<![CDATA[
+new
RichFaces.ui.MenuItem("form:saveAll",{"submitFunction":function(event){RichFaces.ajax("form:saveAll",event,{"incId":"1"}
);return false;}} );
+//]]>
+ </script>
+ </div>
</div>
</div>
</div>
@@ -54,7 +73,7 @@
</div>
<script type="text/javascript">
//<![CDATA[
-new RichFaces.ui.Menu("form:ddmenu",{"mode":"ajax"}
).initiateGroups([{"id":"form:group"} ] );
+new
RichFaces.ui.Menu("form:ddmenu",{"direction":"AA","jointPoint":"AA","mode":"ajax"}
).initiateGroups([{"id":"form:group"} ] );
//]]>
</script>
</div>
\ No newline at end of file
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml 2011-01-10
14:57:44 UTC (rev 20934)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml 2011-01-10
16:22:03 UTC (rev 20935)
@@ -4,9 +4,9 @@
File
</div>
<div class="rf-ddm-pos">
- <div class="rf-ddm-lst" id="form:ddmenu_list"
style="display:none;min-width:250px;">
+ <div class="rf-ddm-lst" id="form:ddmenu_list"
style="display:none;min-width:250px;" tabindex="-1">
<div class="rf-ddm-lst-bg">
- <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:open"
onclick="RichFaces.submitForm("form",{"form:open":"form:open"}
)" onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'" onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:open">
<span class="rf-ddm-itm-ic ">
<div class="rf-ddm-emptyIcon">
</div>
@@ -14,8 +14,14 @@
<span class="rf-ddm-itm-lbl ">
Open
</span>
+ <script type="text/javascript">
+//<![CDATA[
+new RichFaces.ui.MenuItem("form:open", {"submitFunction":
function(event){RichFaces.submitForm("form",
{"form:open":"form:open"})}});
+//]]>
+ </script>
</div>
- <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:group" onmouseout="this.className='rf-ddm-itm
rf-ddm-itm-unsel'" onmouseover="this.className='rf-ddm-itm
rf-ddm-itm-sel '">
+
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:group">
<span class="rf-ddm-itm-ic ">
<div class="rf-ddm-emptyIcon">
</div>
@@ -24,19 +30,25 @@
Save As...
</span>
<div class="rf-ddm-nd">
- <div class="rf-ddm-lst rf-ddm-sublst"
id="form:group_list" style="display:none;min-width:250px;">
+ <div class="rf-ddm-lst rf-ddm-sublst"
id="form:group_list" style="display:none;min-width:250px;"
tabindex="-1">
<div class="rf-ddm-lst-bg">
- <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:save"
onclick="RichFaces.submitForm("form",{"form:save":"form:save"}
)" onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'" onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:save">
<span class="rf-ddm-itm-ic ">
<img src="/images/ddmenu/save.gif"/>
</span>
<span class="rf-ddm-itm-lbl ">
Save
</span>
+ <script
type="text/javascript">
+//<![CDATA[
+new
RichFaces.ui.MenuItem("form:save",{"submitFunction":function(event){RichFaces.submitForm("form",{"form:save":"form:save"}
)}} );
+//]]>
+ </script>
</div>
+
<div class="rf-ddm-sep">
</div>
- <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:saveAll"
onclick="RichFaces.submitForm("form",{"form:saveAll":"form:saveAll"}
)" onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'" onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:saveAll">
<span class="rf-ddm-itm-ic ">
<div class="rf-ddm-emptyIcon">
</div>
@@ -44,7 +56,13 @@
<span class="rf-ddm-itm-lbl ">
SaveAll
</span>
+ <script type="text/javascript">
+//<![CDATA[
+new
RichFaces.ui.MenuItem("form:saveAll",{"submitFunction":function(event){RichFaces.submitForm("form",{"form:saveAll":"form:saveAll"}
)}} );
+//]]>
+ </script>
</div>
+
</div>
</div>
</div>
@@ -54,7 +72,7 @@
</div>
<script type="text/javascript">
//<![CDATA[
-new
RichFaces.ui.Menu("form:ddmenu").initiateGroups([{"id":"form:group"}
] );
+new RichFaces.ui.Menu("form:ddmenu",
{"direction":"AA","jointPoint":"AA"}).initiateGroups([{"id":"form:group"}
] );
//]]>
</script>
</div>
\ No newline at end of file
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml 2011-01-10
14:57:44 UTC (rev 20934)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml 2011-01-10
16:22:03 UTC (rev 20935)
@@ -1,7 +1,4 @@
- <div class="rf-ddm-itm rf-ddm-itm-unsel " id="form:menuItem"
-
onclick="RichFaces.ajax("form:menuItem",event,{"incId":"1"}
);return false;"
- onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'"
- onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:menuItem">
<span class="rf-ddm-itm-ic ">
<div class="rf-ddm-emptyIcon">
</div>
@@ -9,4 +6,9 @@
<span class="rf-ddm-itm-lbl ">
Test
</span>
- </div>
\ No newline at end of file
+ <script type="text/javascript">
+//<![CDATA[
+ new
RichFaces.ui.MenuItem("form:menuItem",{"submitFunction":function(event){RichFaces.ajax("form:menuItem",event,{"incId":"1"}
);return false;}} );
+ //]]>
+ </script>
+ </div>
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xmlunit.xml 2011-01-10
14:57:44 UTC (rev 20934)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_clientMode.xmlunit.xml 2011-01-10
16:22:03 UTC (rev 20935)
@@ -1,6 +1,4 @@
- <div class="rf-ddm-itm rf-ddm-itm-unsel " id="form:menuItem"
- onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'"
- onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
+ <div class="rf-ddm-itm rf-ddm-itm-unsel "
id="form:menuItem">
<span class="rf-ddm-itm-ic ">
<div class="rf-ddm-emptyIcon">
</div>
@@ -8,4 +6,9 @@
<span class="rf-ddm-itm-lbl ">
Test
</span>
- </div>
\ No newline at end of file
+ <script type="text/javascript">
+ //<![CDATA[
+ new RichFaces.ui.MenuItem("form:menuItem");
+//]]>
+ </script>
+ </div>
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xmlunit.xml 2011-01-10
14:57:44 UTC (rev 20934)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_serverMode.xmlunit.xml 2011-01-10
16:22:03 UTC (rev 20935)
@@ -1,12 +1,15 @@
- <div class="rf-ddm-itm rf-ddm-itm-unsel " id="form:menuItem"
-
onclick="RichFaces.submitForm("form",{"form:menuItem":"form:menuItem"}
)"
- onmouseout="this.className='rf-ddm-itm rf-ddm-itm-unsel
'"
- onmouseover="this.className='rf-ddm-itm rf-ddm-itm-sel
'">
- <span class="rf-ddm-itm-ic ">
- <div class="rf-ddm-emptyIcon">
- </div>
- </span>
- <span class="rf-ddm-itm-lbl ">
- Test
- </span>
- </div>
\ No newline at end of file
+ <div class="rf-ddm-itm rf-ddm-itm-unsel " id="form:menuItem">
+ <span class="rf-ddm-itm-ic ">
+ <div class="rf-ddm-emptyIcon">
+ </div>
+ </span>
+ <span class="rf-ddm-itm-lbl ">
+ Test
+ </span>
+ <script type="text/javascript">
+//<![CDATA[
+new RichFaces.ui.MenuItem("form:menuItem", {"submitFunction":
function(event) {RichFaces.submitForm("form",
{"form:menuItem":"form:menuItem"})}});
+ //]]>
+ </script>
+ </div>
+
\ No newline at end of file