Author: pyaschenko
Date: 2011-01-27 13:46:03 -0500 (Thu, 27 Jan 2011)
New Revision: 21290
Modified:
trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
Log:
http://jira.jboss.com/jira/browse/RF-10337
Modified: trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml 2011-01-27
17:23:33 UTC (rev 21289)
+++ trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml 2011-01-27
18:46:03 UTC (rev 21290)
@@ -4,7 +4,9 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:input="http://richfaces.org/input"
+
xmlns:output="http://richfaces.org/output"
xmlns:rich="http://richfaces.org/iteration"
+
xmlns:misc="http://richfaces.org/misc"
xmlns:a4j="http://richfaces.org/a4j">
<f:view contentType="text/html" />
@@ -126,7 +128,18 @@
</h:column>
</input:autocomplete>
</h:form>
-
+ <h:form>
+ <h:commandButton id="leggTilKontroll" value="Button">
+ <misc:componentControl target="popup" operation="show" />
+ </h:commandButton>
+ </h:form>
+ <output:popupPanel id="popup" autosized="true">
+ <h:form>
+ <input:autocomplete mode="cachedAjax"
autocompleteMethod="#{autoCompleteBean.autocomplete}" var="country"
fetchValue="#{country.name}">
+ #{country.name} #{country.iso} #{country.domain}
+ </input:autocomplete>
+ </h:form>
+ </output:popupPanel>
</ui:define>
</ui:composition>
Modified: trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
===================================================================
---
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2011-01-27
17:23:33 UTC (rev 21289)
+++
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2011-01-27
18:46:03 UTC (rev 21290)
@@ -53,7 +53,7 @@
if (!this.visible) {
if (this.attachToBody) {
this.parentElement = this.popup.parent();
- this.popup.detach().appendTo("body");
+ document.body.appendChild(this.popup.get(0));
}
this.visible = true;
}
@@ -66,7 +66,7 @@
this.popup.hide();
this.visible = false;
if (this.attachToBody && this.parentElement) {
- this.popup.detach().appendTo(this.parentElement);
+ his.parentElement.appendChild(this.popup.get(0));
this.parentElement = null;
}
}
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js 2011-01-27
17:23:33 UTC (rev 21289)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutocompleteBase.js 2011-01-27
18:46:03 UTC (rev 21290)
@@ -199,12 +199,12 @@
if (!this.isVisible) {
if (this.__onBeforeShow(event)!=false) {
this.scrollElements = rf.Event.bindScrollEventHandlers(this.selectId, this.hide,
this, this.namespace);
+ var element = rf.getDomElement(this.selectId);
if (this.options.attachToBody) {
- var element = rf.getDomElement(this.selectId);
this.parentElement = element.parentNode;
- $(element).detach().appendTo("body");
+ document.body.appendChild(element);
}
- $(rf.getDomElement(this.selectId)).setPosition({id: this.fieldId},
{type:"DROPDOWN"}).show();
+ $(element).setPosition({id: this.fieldId}, {type:"DROPDOWN"}).show();
this.isVisible = true;
this.__onShow(event);
}
@@ -214,10 +214,10 @@
if (this.isVisible) {
rf.Event.unbindScrollEventHandlers(this.scrollElements, this);
this.scrollElements = null;
- $(rf.getDomElement(this.selectId)).hide();
- this.isVisible = false;
- if (this.options.attachToBody && this.parentElement) {
- $(rf.getDomElement(this.selectId)).detach().appendTo(this.parentElement);
+ $(rf.getDomElement(this.selectId)).hide();
+ this.isVisible = false;
+ if (this.options.attachToBody && this.parentElement) {
+ this.parentElement.appendChild(rf.getDomElement(this.selectId));
this.parentElement = null;
}
this.__onHide(event);
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2011-01-27
17:23:33 UTC (rev 21289)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2011-01-27
18:46:03 UTC (rev 21290)
@@ -240,9 +240,9 @@
if (newParent != this.parent) {
this.saveInputValues(element);
- this.shadeDiv.insertAfter($(newParent).children().last());
- this.shadowDiv.insertAfter($(newParent).children().last());
- this.cdiv.insertAfter($(newParent).children().last());
+ newParent.appendChild(this.shadeDiv.get(0));
+ newParent.appendChild(this.shadowDiv.get(0));
+ newParent.appendChild(this.cdiv.get(0));
this.domReattached = true;
} else {
this.parent.show();
@@ -487,9 +487,10 @@
if (this.parent) {
if (this.domReattached) {
this.saveInputValues(element);
- this.div.append(this.shadeDiv);
- this.div.append(this.shadowDiv);
- this.div.append(element);
+ var div = this.div.get(0);
+ div.appendChild(this.shadeDiv.get(0));
+ div.appendChild(this.shadowDiv.get(0));
+ div.appendChild(element.get(0));
this.domReattached = false;
}