Author: abelevich
Date: 2010-09-09 09:56:31 -0400 (Thu, 09 Sep 2010)
New Revision: 19144
Modified:
branches/RF-8992/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
branches/RF-8992/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
branches/RF-8992/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
branches/RF-8992/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
branches/RF-8992/ui/input/ui/src/main/templates/inplaceSelect.template.xml
Log:
Modified:
branches/RF-8992/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
---
branches/RF-8992/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2010-09-09
11:17:48 UTC (rev 19143)
+++
branches/RF-8992/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2010-09-09
13:56:31 UTC (rev 19144)
@@ -168,7 +168,7 @@
JSFunction function = new JSFunction(scriptName);
String clientId = component.getClientId(facesContext);
Map<String, Object> options = createInplaceComponentOptions(clientId,
(InplaceComponent)component);
- addToOptions(component, options);
+ addToOptions(facesContext, component, options);
function.addParameter(clientId);
function.addParameter(options);
writer.write(function.toString());
@@ -199,7 +199,7 @@
return options;
}
- public void addToOptions(UIComponent component, Map<String, Object> parameters)
{
+ public void addToOptions(FacesContext facesContext, UIComponent component,
Map<String, Object> options) {
//override this method if you need additional options
}
Modified:
branches/RF-8992/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
---
branches/RF-8992/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-09-09
11:17:48 UTC (rev 19143)
+++
branches/RF-8992/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-09-09
13:56:31 UTC (rev 19144)
@@ -3,6 +3,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
@@ -25,14 +26,23 @@
*/
@ResourceDependencies({ @ResourceDependency(library = "javax.faces", name =
"jsf.js"),
- @ResourceDependency(name = "jquery.js"), @ResourceDependency(name =
"richfaces.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "jquery.position.js"),
+ @ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
- @ResourceDependency(library="org.richfaces", name =
"inplaceInput.js"),
- @ResourceDependency(library="org.richfaces", name =
"inplaceSelect.js"),
- @ResourceDependency(library="org.richfaces", name =
"inplaceSelect.ecss") })
+ @ResourceDependency(name = "richfaces-selection.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"inplaceInput.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"AutocompleteBase.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"Autocomplete.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"inplaceSelect.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"inplaceSelect.ecss") })
public class InplaceSelectBaseRenderer extends InplaceInputBaseRenderer {
+ public static final String OPTIONS_ITEM_CLASS = "itemClass";
+
+ public static final String OPTIONS_SELECTED_ITEM_CLASS =
"selectedItemClass";
+
protected static final class ClientSelectItem implements ScriptString {
private String label;
private String convertedValue;
@@ -77,6 +87,12 @@
return clientSelectItems;
}
+ @Override
+ public void addToOptions(FacesContext facesContext, UIComponent component,
Map<String, Object> options) {
+ options.put(OPTIONS_ITEM_CLASS, "insel_option");
+ options.put(OPTIONS_SELECTED_ITEM_CLASS, "insel_select");
+ }
+
public void encodeOptions(FacesContext facesContext, UIComponent component,
List<ClientSelectItem> clientSelectItems) throws IOException {
AbstractInplaceSelect inplaceSelect = (AbstractInplaceSelect)component;
if(clientSelectItems != null && !clientSelectItems.isEmpty()) {
Modified:
branches/RF-8992/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
---
branches/RF-8992/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-09-09
11:17:48 UTC (rev 19143)
+++
branches/RF-8992/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-09-09
13:56:31 UTC (rev 19144)
@@ -67,12 +67,13 @@
// define super class link
var $super = rf.ui.InplaceInput.$super;
-
+
$.extend(rf.ui.InplaceInput.prototype, ( function () {
var isSaved = false;
var isValueChanged = false;
+
return {
name : "inplaceInput",
Modified:
branches/RF-8992/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
---
branches/RF-8992/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-09-09
11:17:48 UTC (rev 19143)
+++
branches/RF-8992/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-09-09
13:56:31 UTC (rev 19144)
@@ -3,18 +3,32 @@
rf.ui = rf.ui || {};
rf.ui.InplaceSelect = function(id, options) {
- $super.constructor.call(this, id, options);
+ $super.constructor.call(this, id, options)
+ this.proxy = new rf.ui.Autocomplete(id, options.input, defaultOptions);
}
-
+
rf.ui.InplaceInput.extend(rf.ui.InplaceSelect);
-
var $super = rf.ui.InplaceSelect.$super;
- $.extend(rf.ui.InplaceSelect.prototype, function () {
+ var defaultOptions = {
+ selectedItemClass:'insel_select',
+ itemClass:'insel_option',
+ autofill:false,
+ minChars:0,
+ selectFirst:false,
+ ajaxMode:false,
+ lazyClientMode:false,
+ attachToBody:true,
+ filterFunction: function () {return true;}
+ };
+
+ $.extend(rf.ui.InplaceSelect.prototype, ( function () {
+
return{
name : "inplaceSelect"
}
- })
+
+ })());
})(jQuery, window.RichFaces);
Modified: branches/RF-8992/ui/input/ui/src/main/templates/inplaceSelect.template.xml
===================================================================
--- branches/RF-8992/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-09-09
11:17:48 UTC (rev 19143)
+++ branches/RF-8992/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-09-09
13:56:31 UTC (rev 19144)
@@ -78,7 +78,7 @@
</span>
</c:if>
<br/>
- <span class="insel_list_cord">
+ <span id="#{clientId}List" class="insel_list_cord">
<span class="insel_list_position" style="width:
#{component.attributes['listWidth']}">
<span class="insel_shadow">
<span class="insel_shadow_t"></span>
@@ -86,7 +86,7 @@
<span class="insel_shadow_r"></span>
<span class="insel_shadow_b"></span>
<span class="insel_list_decoration">
- <span class="insel_list_scroll" style="height:
#{component.attributes['listHeight']}">
+ <span class="insel_list_scroll" id="#{clientId}Items"
style="height: #{component.attributes['listHeight']}">
<cdk:call expression="encodeOptions(facesContext, component,
clientSelectItems);"/>
</span>
</span>