JBoss Rich Faces SVN: r5344 - in trunk/sandbox/ui/combobox/src/main: java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-14 07:01:18 -0500 (Mon, 14 Jan 2008)
New Revision: 5344
Modified:
trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
trunk/sandbox/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java
trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
defaultLabel correct processing
Modified: trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml 2008-01-14 12:00:18 UTC (rev 5343)
+++ trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml 2008-01-14 12:01:18 UTC (rev 5344)
@@ -57,12 +57,6 @@
<defaultvalue>true</defaultvalue>
</property>
<property>
- <name>defaultMessage</name>
- <classname>java.lang.String</classname>
- <description></description>
- </property>
-
- <property>
<name>showDelay</name>
<classname>java.lang.Integer</classname>
<description></description>
Modified: trunk/sandbox/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java
===================================================================
--- trunk/sandbox/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java 2008-01-14 12:00:18 UTC (rev 5343)
+++ trunk/sandbox/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java 2008-01-14 12:01:18 UTC (rev 5344)
@@ -16,5 +16,9 @@
public abstract Object getSuggestionValues();
public abstract void setSuggestionValues(Object value);
+ public abstract String getDefaultLabel();
+ public abstract void setDefaultLabel(String label);
+
+
}
\ No newline at end of file
Modified: trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java 2008-01-14 12:00:18 UTC (rev 5343)
+++ trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java 2008-01-14 12:01:18 UTC (rev 5344)
@@ -74,7 +74,9 @@
Map request = context.getExternalContext().getRequestParameterMap();
if (request.containsKey(clientId)) {
String newValue = (String)request.get(clientId);
- comboBox.setSubmittedValue(newValue);
+ if (!newValue.equals(comboBox.getDefaultLabel())) {
+ comboBox.setSubmittedValue(newValue);
+ }
}
}
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-14 12:00:18 UTC (rev 5343)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-14 12:01:18 UTC (rev 5344)
@@ -61,6 +61,9 @@
Object value = component.getAttributes().get("value");
value = getConvertedStringValue(context, component,value);
+ if (value == null || value.equals("")) {
+ value = defaultLabel;
+ }
variables.setVariable("value", value);
Object inputStyle = component.getAttributes().get("inputStyle");
@@ -183,7 +186,8 @@
}
]]>
</jsp:scriptlet>
- <div id="#{clientId}" class="rich-combobox-font rich-combobox-shell #{styleClass}" style="width:#{listWidth}; #{style}">
+ <div id="#{clientId}" class="rich-combobox-font rich-combobox-shell #{styleClass}" style="width:#{listWidth}; #{style}"
+ x:passThruWithExclusions="value,name,type,id,styleClass,class,style,size,autocomplete,disabled,onchange">
<div class="rich-combobox-font rich-combobox-shell" style="width:#{width}">
<input id="comboboxField#{clientId}"
name="comboboxField#{clientId}"
@@ -192,9 +196,10 @@
value="#{value}"
size="#{inputSize}"
autocomplete="off"
- onchange='#{component.attributes["onchange"]}'
+ onchange="#{component.attributes['onchange']}"
+ onselect="#{component.attributes['onselect']}"
+ onblur="#{component.attributes['onblur']}"
style="width:#{width}; #{inputStyle}"
- x:passThruWithExclusions="value,name,type,id,styleClass,class,style,size,autocomplete,disabled,onchange"
/>
<input id="comboBoxButtonBG#{clientId}" readonly="true" type="text" value="" class="rich-combobox-font rich-combobox-button-background rich-combobox-button"/>
<input id="comboboxButton#{clientId}" readonly="true" disabled="#{disabled}" type="text" value="" style="#{buttonStyle}"
17 years
JBoss Rich Faces SVN: r5343 - management/design/comboBox/markup.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-01-14 07:00:18 -0500 (Mon, 14 Jan 2008)
New Revision: 5343
Modified:
management/design/comboBox/markup/ComboBox_Iframe.html
Log:
Not correct positioning several components
Modified: management/design/comboBox/markup/ComboBox_Iframe.html
===================================================================
--- management/design/comboBox/markup/ComboBox_Iframe.html 2008-01-14 10:30:46 UTC (rev 5342)
+++ management/design/comboBox/markup/ComboBox_Iframe.html 2008-01-14 12:00:18 UTC (rev 5343)
@@ -62,6 +62,32 @@
</div>
</div>
</div>
+<div class="cb_width_list cb_font cb_shell">
+ <div class="cb_width_field cb_font cb_shell">
+ <input type="Text" value="Input text or select option" class="cb_width_field cb_font cb_field">
+ <input readonly="" type="Text" value="" class="cb_button cb_font cb_button_bg">
+ <input readonly="" type="Text" value="" class="cb_button cb_font cb_button_arrow" onmouseover="this.className='cb_button cb_font cb_button_arrow cb_button_select'" onmouseout="this.className='cb_button cb_font cb_button_arrow'">
+ <input type="Text"class="cb_width_field cb_strut cb_font">
+ </div><div class="cb_list_cord">
+ <iframe class="cb_width_list cb_list_scroll cb_list_position" frameborder="0"></iframe>
+ <div class="cb_list_position cb_width_list">
+ <div class="cb_list_decoration">
+ <div class="cb_list_scroll">
+ <div class="cb_option cb_font">Option 1</div>
+ <div class="cb_option cb_font">Option 2</div>
+ <div class="cb_option cb_font">Option 3</div>
+ <div class="cb_option cb_font">Option 4</div>
+ <div class="cb_option cb_font cb_select">Opt</div>
+ <div class="cb_option cb_font">Option 6</div>
+ <div class="cb_option cb_font">Option 7</div>
+ <div class="cb_option cb_font">Option 8</div>
+ <div class="cb_option cb_font">Option 9</div>
+ <div class="cb_option cb_font">Option 0</div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
17 years
JBoss Rich Faces SVN: r5342 - in trunk/sandbox/ui/combobox/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-01-14 05:30:46 -0500 (Mon, 14 Jan 2008)
New Revision: 5342
Modified:
trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
latest changes
Modified: trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml 2008-01-14 10:30:40 UTC (rev 5341)
+++ trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml 2008-01-14 10:30:46 UTC (rev 5342)
@@ -62,6 +62,26 @@
<description></description>
</property>
+ <property>
+ <name>showDelay</name>
+ <classname>java.lang.Integer</classname>
+ <description></description>
+ <defaultvalue><![CDATA[0]]></defaultvalue>
+ </property>
+ <property>
+ <name>hideDelay</name>
+ <classname>java.lang.Integer</classname>
+ <description></description>
+ <defaultvalue><![CDATA[0]]></defaultvalue>
+ </property>
+
+ <property>
+ <name>width</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA["150"]]></defaultvalue>
+ </property>
+
<property>
<name>width</name>
<classname>java.lang.String</classname>
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-14 10:30:40 UTC (rev 5341)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-14 10:30:46 UTC (rev 5342)
@@ -3,7 +3,11 @@
Richfaces.ComboBox.prototype = {
- initialize: function(combobox, listId, parentListId, fieldId, buttonId,buttonBGId, classes, listWidth, listHeight, itemsText, directInputSuggestions, filterNewValue, selectFirstOnUpdate, onlistcall, onselected, defaultMessage, isDisabled, value) {
+ initialize: function(combobox, listId, parentListId, fieldId, buttonId, buttonBGId, classes,
+ listWidth, listHeight, itemsText, directInputSuggestions, filterNewValue,
+ selectFirstOnUpdate, onlistcall, onselected, defaultMessage, isDisabled, value,
+ showDelay, hideDelay) {
+
this.directInputSuggestions = directInputSuggestions;
this.filterNewValue = filterNewValue;
@@ -14,9 +18,10 @@
var fieldDem = Richfaces.ComboBoxList.getElemXY(this.field);
fieldDem.height = this.field.offsetHeight;
listWidth = (!listWidth) ? this.getCurrentWidth() : listWidth;
- this.comboList = new Richfaces.ComboBoxList(listId, parentListId, selectFirstOnUpdate, classes.COMBO_LIST, listWidth, listHeight, itemsText, onlistcall, fieldDem);
- this.defaultMessage = defaultMessage;
+ this.comboList = new Richfaces.ComboBoxList(listId, parentListId, selectFirstOnUpdate, classes.COMBO_LIST, listWidth,
+ listHeight, itemsText, onlistcall, fieldDem, showDelay, hideDelay);
+ this.defaultMessage = defaultMessage;
if (value) {
var item = this.comboList.findItemBySubstr(value);
if (item) {
@@ -27,22 +32,16 @@
this.applyDefaultText();
}
}
-
this.onselected = onselected;
-
this.isSelection = true;
-
this.classes = classes;
this.isDisabled = isDisabled;
-
if (this.onselected) {
this.combobox.observe("rich:onitemselected", this.onselected);
}
-
if (this.isDisabled) {
this.doDisable();
}
-
this.initHandlers();
},
@@ -65,10 +64,10 @@
buttonClickHandler : function(event) {
if (this.comboList.visible()) {
- this.comboList.hide();
+ this.comboList.hideWithDelay();
} else {
this.comboList.createDefaultList();
- this.comboList.show();
+ this.comboList.showWithDelay();
if (this.comboList.selectedItem) {
this.comboList.scrollingUpToItem(this.comboList.selectedItem);
}
@@ -128,27 +127,22 @@
this.isSelection = false;
this.field.focus();
this.setValue(true);
- this.comboList.hide();
+ this.comboList.hideWithDelay();
},
fieldKeyDownHandler : function(event) {
switch (event.keyCode) {
case Event.KEY_RETURN :
this.setValue(true);
- this.comboList.hide();
+ this.comboList.hideWithDelay();
Event.stop(event);
break;
- //case Event.KEY_BACKSPACE :
- // this.comboList.hide();
- // break;
case Event.KEY_DOWN :
this.comboList.moveActiveItem(event);
break;
case Event.KEY_UP :
this.comboList.moveActiveItem(event);
break;
- default :
- //this.dataUpdating(event);
}
},
@@ -175,7 +169,7 @@
this.comboList.doSelectItem(item);
}
}
- this.comboList.hide();
+ this.comboList.hideWithDelay();
this.doNormal();
} else {
this.doActive();
@@ -191,16 +185,16 @@
dataUpdating : function(event) {
if (Richfaces.ComboBox.SPECIAL_KEYS.indexOf(event.keyCode) == -1) {
- this.comboList.hide();
+ this.comboList.hideWithDelay();
if (this.filterNewValue) {
this.comboList.dataFilter(this.field.value);
if (this.comboList.getItems() && this.comboList.getItems().length != 0) {
var isSearchSuccessful = true;
- this.comboList.show();
+ this.comboList.showWithDelay();
}
} else {
if (!this.comboList.visible()) {
- this.comboList.show();
+ this.comboList.showWithDelay();
}
var item = this.comboList.findItemBySubstr(this.field.value);
if (item) {
@@ -292,7 +286,8 @@
Richfaces.ComboBoxList = Class.create();
Richfaces.ComboBoxList.prototype = {
- initialize: function(listId, parentListId, selectFirstOnUpdate, classes, width, height, itemsText, onlistcall, fieldXY) {
+ initialize: function(listId, parentListId, selectFirstOnUpdate, classes, width, height, itemsText, onlistcall, fieldXY,
+ showDelay, hideDelay) {
this.list = $(listId);
this.listParent = $(parentListId);
@@ -314,6 +309,8 @@
this.selectedItem = null;
this.activeItem = null;
+ this.showDelay = showDelay;
+ this.hideDelay = hideDelay;
this.width = width;
this.height = height;
@@ -346,13 +343,19 @@
return this.list.childNodes;
},
+ showWithDelay : function() {
+ this.show();
+ /*setTimeout(function(){
+ this.show();
+ }.bind(this), this.showDelay);*/
+ },
+
show : function() {
this.setSize();
this.setPosition(this.fieldDimensions.top, this.fieldDimensions.left, this.fieldDimensions.height);
if (this.selectedItem) {
//was created new item list, so necessary to recreate selectedItem
- //alert(this.selectedItem.innerHTML);
this.doSelectItem(this.findItemBySubstr(this.selectedItem.innerHTML));
}
@@ -371,6 +374,13 @@
},
+ hideWithDelay : function() {
+ /*setTimeout(function(){
+ this.hide();
+ }.bind(this), this.hideDelay);*/
+ this.hide();
+ },
+
hide : function() {
this.resetState();
this.listParent.hide();
@@ -398,7 +408,6 @@
rowsAmount = this.getItems().length;
currentItemsHeight = itemHeight * rowsAmount;
}
-
if (this.height && (parseInt(this.height) < currentItemsHeight)) {
if (this.height < currentItemsHeight) {
height = currentItemsHeight;
@@ -410,16 +419,9 @@
height = itemHeight * this.defaultRowsAmount;
}
}
-
- /*if (Prototype.Browser.IE) {
- height = parseInt(height) + Richfaces.ComboBoxList.LAYOUT_BORDER_V + Richfaces.ComboBoxList.LAYOUT_PADDING_V;
- }*/
- //this.listParent.style.height = height;
this.list.style.height = height;
- //if (this.width) {
this.setWidth(this.width);
- //}
},
setWidth : function(width) {
@@ -432,8 +434,6 @@
positionElem.style.width = width;
this.list.style.width = parseInt(width) - Richfaces.getBorderWidth(positionElem.firstChild, "lr") - Richfaces.getPaddingWidth(positionElem.firstChild, "lr");
-
- //this.list.style.width = width;
},
setPosition : function(fieldTop, fieldLeft, fieldHeight) {
@@ -444,7 +444,6 @@
var top = -4;
if (parseInt(listHeight) > (docHeight - comBottom)) {
if (fieldTop > (docHeight - comBottom)) {
- //this.listParent.style.bottom = 0 + "px"; //FIXME
top -= (parseInt(listHeight) + fieldHeight);
}
}
@@ -454,7 +453,6 @@
scrolling : function(event) {
var increment;
- //var scrollElem = this.listParent;
var scrollElem = this.list;
var listTop = Richfaces.ComboBoxList.getElemXY(scrollElem).top;
var scrollTop = scrollElem.scrollTop;
@@ -476,7 +474,6 @@
},
scrollingUpToItem : function(item) {
- //var scrollElem = this.listParent;
var scrollElem = this.list;
var increment = (Richfaces.ComboBoxList.getElemXY(item).top - scrollElem.scrollTop) - Richfaces.ComboBoxList.getElemXY(scrollElem).top;
scrollElem.scrollTop += increment;
@@ -533,15 +530,12 @@
},
itemsRearrangement : function(item, newItem) {
- //this.doNormalItem(item);
this.doActiveItem(newItem);
},
resetState : function() {
var tempList = this.list.cloneNode(false);
- //this.listParent.replaceChild(tempList, this.listParent.firstChild);
this.listParent.childNodes[1].firstChild.replaceChild(tempList, this.list);
- //this.list = this.listParent.firstChild;
this.list = $(tempList.id);
this.activeItem = null;
this.isList = false;
@@ -573,13 +567,6 @@
}
},
- /*findItemByText : function(text) {
- var id = this.itemsText.indexOf(text);
- if (id != -1) {
- return this.getItems()[this.itemsText.indexOf(text)];
- }
- },*/
-
createNewList : function(items) {
//FIX for FF
if (this.selectedItem) {
@@ -593,7 +580,6 @@
this.doSelectItem(item);
}
}
- //this.listParent.appendChild(tempList);
},
createItem : function(text, className) {
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-14 10:30:40 UTC (rev 5341)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-14 10:30:46 UTC (rev 5342)
@@ -192,8 +192,9 @@
value="#{value}"
size="#{inputSize}"
autocomplete="off"
+ onchange='#{component.attributes["onchange"]}'
style="width:#{width}; #{inputStyle}"
- x:passThruWithExclusions="value,name,type,id,styleClass,class,style,size,autocomplete,disabled"
+ x:passThruWithExclusions="value,name,type,id,styleClass,class,style,size,autocomplete,disabled,onchange"
/>
<input id="comboBoxButtonBG#{clientId}" readonly="true" type="text" value="" class="rich-combobox-font rich-combobox-button-background rich-combobox-button"/>
<input id="comboboxButton#{clientId}" readonly="true" disabled="#{disabled}" type="text" value="" style="#{buttonStyle}"
@@ -272,6 +273,7 @@
#{this:getAsEventHandler(context, component, "onlistcall")},
#{this:getAsEventHandler(context, component, "onitemselected")},
"#{defaultLabel}",
- #{disabled}, "#{value}");
+ #{disabled}, "#{value}",
+ #{component.attributes["showDelay"]}, #{component.attributes["hideDelay"]});
</script>
</f:root>
\ No newline at end of file
17 years
JBoss Rich Faces SVN: r5341 - trunk/sandbox/samples/combobox-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-14 05:30:40 -0500 (Mon, 14 Jan 2008)
New Revision: 5341
Modified:
trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp
Log:
Modified: trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp 2008-01-14 10:28:18 UTC (rev 5340)
+++ trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp 2008-01-14 10:30:40 UTC (rev 5341)
@@ -57,8 +57,9 @@
<h:inputText value="#{bean.onitemselectedScript}" />
</h:panelGrid>
-
-
+ <h:commandButton action="none" value="apply"></h:commandButton>
+ </h:form>
+ <h:form>
<cmb:comboBox
disabled="#{bean.disabled}"
inputClass="inputClass"
17 years
JBoss Rich Faces SVN: r5340 - in trunk/sandbox/samples/combobox-sample/src/main: webapp/WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-14 05:28:18 -0500 (Mon, 14 Jan 2008)
New Revision: 5340
Modified:
trunk/sandbox/samples/combobox-sample/src/main/java/org/richfaces/samples/Bean.java
trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp
Log:
new Demo
Modified: trunk/sandbox/samples/combobox-sample/src/main/java/org/richfaces/samples/Bean.java
===================================================================
--- trunk/sandbox/samples/combobox-sample/src/main/java/org/richfaces/samples/Bean.java 2008-01-14 10:27:44 UTC (rev 5339)
+++ trunk/sandbox/samples/combobox-sample/src/main/java/org/richfaces/samples/Bean.java 2008-01-14 10:28:18 UTC (rev 5340)
@@ -37,8 +37,25 @@
String suggestions = "Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Maryland,Massachusetts,Michigan,Georgia,Hawaii,Idaho,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Minnesota,Mississippi,Missouri,Montana,Nebraska";
List selectItems = new ArrayList();
+ private boolean disabled = false;
+ private boolean enableManualInput = false;
+ private boolean selectFirstOnUpdate = true;
+ private boolean filterNewValues = true;
+ private boolean directInputSuggestions = true;
+ private String defaultMessage = "default message ...";
+ private String width = "150px";
+ private String listWidth = "150px";
+ private String listHeight = "100px";
+ private String inputSize;
+ private String onchangeScript;
+ private String onlistcallScript;
+ private String onitemselectedScript;
+
+
private String state="";
-
+
+
+
public String getState() {
return state;
}
@@ -83,5 +100,109 @@
public void setSelectItems(List selectItems) {
this.selectItems = selectItems;
}
+
+ public boolean isDisabled() {
+ return disabled;
+ }
+
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
+
+ public boolean isEnableManualInput() {
+ return enableManualInput;
+ }
+
+ public void setEnableManualInput(boolean enableManualInput) {
+ this.enableManualInput = enableManualInput;
+ }
+
+ public boolean isSelectFirstOnUpdate() {
+ return selectFirstOnUpdate;
+ }
+
+ public void setSelectFirstOnUpdate(boolean selectFirstOnUpdate) {
+ this.selectFirstOnUpdate = selectFirstOnUpdate;
+ }
+
+ public boolean isFilterNewValues() {
+ return filterNewValues;
+ }
+
+ public void setFilterNewValues(boolean filterNewValues) {
+ this.filterNewValues = filterNewValues;
+ }
+
+ public boolean isDirectInputSuggestions() {
+ return directInputSuggestions;
+ }
+
+ public void setDirectInputSuggestions(boolean directInputSuggestions) {
+ this.directInputSuggestions = directInputSuggestions;
+ }
+
+ public String getDefaultMessage() {
+ return defaultMessage;
+ }
+
+ public void setDefaultMessage(String defaultMessage) {
+ this.defaultMessage = defaultMessage;
+ }
+
+ public String getWidth() {
+ return width;
+ }
+
+ public void setWidth(String width) {
+ this.width = width;
+ }
+
+ public String getListWidth() {
+ return listWidth;
+ }
+
+ public void setListWidth(String listWidth) {
+ this.listWidth = listWidth;
+ }
+
+ public String getListHeight() {
+ return listHeight;
+ }
+
+ public void setListHeight(String listHeight) {
+ this.listHeight = listHeight;
+ }
+
+ public String getInputSize() {
+ return inputSize;
+ }
+
+ public void setInputSize(String inputSize) {
+ this.inputSize = inputSize;
+ }
+
+ public String getOnchangeScript() {
+ return onchangeScript;
+ }
+
+ public void setOnchangeScript(String onchangeScript) {
+ this.onchangeScript = onchangeScript;
+ }
+
+ public String getOnlistcallScript() {
+ return onlistcallScript;
+ }
+
+ public void setOnlistcallScript(String onlistcallScript) {
+ this.onlistcallScript = onlistcallScript;
+ }
+
+ public String getOnitemselectedScript() {
+ return onitemselectedScript;
+ }
+
+ public void setOnitemselectedScript(String onitemselectedScript) {
+ this.onitemselectedScript = onitemselectedScript;
+ }
}
\ No newline at end of file
Modified: trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/faces-config.xml 2008-01-14 10:27:44 UTC (rev 5339)
+++ trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/faces-config.xml 2008-01-14 10:28:18 UTC (rev 5340)
@@ -3,8 +3,14 @@
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<managed-bean>
- <managed-bean-name>bean</managed-bean-name>
- <managed-bean-class>org.richfaces.samples.Bean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>org.richfaces.samples.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>skinBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.SkinBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+</managed-bean>
</faces-config>
Modified: trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/web.xml 2008-01-14 10:27:44 UTC (rev 5339)
+++ trunk/sandbox/samples/combobox-sample/src/main/webapp/WEB-INF/web.xml 2008-01-14 10:28:18 UTC (rev 5340)
@@ -8,7 +8,7 @@
</context-param>
<context-param>
<param-name>org.ajax4jsf.SKIN</param-name>
- <param-value>blueSky</param-value>
+ <param-value>#{skinBean.skin}</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
Modified: trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp 2008-01-14 10:27:44 UTC (rev 5339)
+++ trunk/sandbox/samples/combobox-sample/src/main/webapp/pages/index.jsp 2008-01-14 10:28:18 UTC (rev 5340)
@@ -1,5 +1,6 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/ui/combobox" prefix="cmb"%>
<html>
<head>
@@ -7,8 +8,79 @@
</head>
<body>
<f:view>
+
<h:form>
- <cmb:comboBox value="#{bean.state}" valueChangeListener="#{bean.selectionChanged}" suggestionValues="#{bean.suggestions}" listWidth="150px">
+ <h:selectOneRadio binding="#{skinBean.component}" />
+ <h:commandLink action="#{skinBean.change}" value="set skin" />
+ <h:outputText value="Current skin: #{skinBean.skin}"/><br />
+ </h:form>
+
+ <h:form>
+ <h:panelGrid columns="2">
+ <h:outputText value="is disable (default: false):" />
+ <h:selectBooleanCheckbox value="#{bean.disabled}" />
+
+ <h:outputText value="enableManualInput (default: false):" />
+ <h:selectBooleanCheckbox value="#{bean.enableManualInput}" />
+
+ <h:outputText value="selectFirstOnUpdate (default: true):" />
+ <h:selectBooleanCheckbox value="#{bean.selectFirstOnUpdate}" />
+
+ <h:outputText value="filterNewValues (default: true):" />
+ <h:selectBooleanCheckbox value="#{bean.filterNewValues}" />
+
+ <h:outputText value="directInputSuggestions (default: true):" />
+ <h:selectBooleanCheckbox value="#{bean.directInputSuggestions}" />
+
+ <h:outputText value="defaultMessage is:" />
+ <h:inputText value="#{bean.defaultMessage}" />
+
+ <h:outputText value="width (in 'px'):" />
+ <h:inputText value="#{bean.width}" />
+
+ <h:outputText value="listWidth (in 'px'):" />
+ <h:inputText value="#{bean.listWidth}" />
+
+ <h:outputText value="listHeight (in 'px'):" />
+ <h:inputText value="#{bean.listHeight}" />
+
+ <h:outputText value="inputSize:" />
+ <h:inputText value="#{bean.inputSize}" />
+
+ <h:outputText value="onchange event script:" />
+ <h:inputText value="#{bean.onchangeScript}" />
+
+ <h:outputText value="onlistcall event script:" />
+ <h:inputText value="#{bean.onlistcallScript}" />
+
+ <h:outputText value="onitemselected event script:" />
+ <h:inputText value="#{bean.onitemselectedScript}" />
+
+ </h:panelGrid>
+
+
+ <cmb:comboBox
+ disabled="#{bean.disabled}"
+ inputClass="inputClass"
+ buttonDisabledClass="buttonDisabledClass"
+ buttonClass="buttonClass"
+ listClass="listClass"
+ value="#{bean.defaultMessage}"
+ valueChangeListener="#{bean.selectionChanged}"
+ suggestionValues="#{bean.suggestions}"
+ width = "#{bean.width}"
+ listWidth="#{bean.listWidth}"
+ listHeight="#{bean.listHeight}"
+ enableManualInput="#{bean.enableManualInput}"
+ selectFirstOnUpdate="#{bean.selectFirstOnUpdate}"
+ filterNewValues="#{bean.filterNewValues}"
+ directInputSuggestions="#{bean.directInputSuggestions}"
+ defaultMessage="#{bean.defaultMessage}"
+ inputSize="#{bean.inputSize}"
+ onchange="#{bean.onchangeScript}"
+ onlistcall="#{bean.onlistcallScript}"
+ onitemselected="#{bean.onitemselectedScript}">
+
<f:selectItems value="#{bean.selectItems}"/>
<f:selectItem itemValue="Oregon"/>
<f:selectItem itemValue="Pennsylvania"/>
17 years
JBoss Rich Faces SVN: r5339 - trunk/sandbox/ui/combobox/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-14 05:27:44 -0500 (Mon, 14 Jan 2008)
New Revision: 5339
Modified:
trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
Log:
Modified: trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml 2008-01-14 09:22:33 UTC (rev 5338)
+++ trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml 2008-01-14 10:27:44 UTC (rev 5339)
@@ -39,11 +39,6 @@
<defaultvalue>false</defaultvalue>
</property>
<property>
- <name>selectFirstOnUpdate</name>
- <classname>boolean</classname>
- <defaultvalue>true</defaultvalue>
- </property>
- <property>
<name>filterNewValues</name>
<classname>java.lang.Boolean</classname>
<description></description>
17 years
JBoss Rich Faces SVN: r5338 - trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-14 04:22:33 -0500 (Mon, 14 Jan 2008)
New Revision: 5338
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
fix button hover
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-14 09:22:17 UTC (rev 5337)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-14 09:22:33 UTC (rev 5338)
@@ -248,12 +248,16 @@
},
isActive : function() {
- return (this.field.className == this.classes.FIELD.ACTIVE);
+ return (this.field.className == this.classes.FIELD.CLASSES.ACTIVE);
},
doActive : function() {
- this.button.className = this.classes.BUTTON.CLASSES.ACTIVE + " " + this.classes.BUTTON.CLASSES.HOVERED;
+ if (this.button.className.indexOf(this.classes.BUTTON.CLASSES.HOVERED) != -1) {
+ this.button.className = this.classes.BUTTON.CLASSES.ACTIVE + " " + this.classes.BUTTON.CLASSES.HOVERED;
+ } else {
+ this.button.className = this.classes.BUTTON.CLASSES.ACTIVE ;
+ }
this.field.className = this.classes.FIELD.CLASSES.ACTIVE;
this.buttonBG.className = this.classes.BUTTONBG.CLASSES.ACTIVE;
this.isDisabled = false;
17 years
JBoss Rich Faces SVN: r5337 - trunk/sandbox/ui/combobox/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-14 04:22:17 -0500 (Mon, 14 Jan 2008)
New Revision: 5337
Modified:
trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
remove onmouseup onmousedown listeners from comboboxButton elements
Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-14 08:54:30 UTC (rev 5336)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx 2008-01-14 09:22:17 UTC (rev 5337)
@@ -198,8 +198,8 @@
<input id="comboBoxButtonBG#{clientId}" readonly="true" type="text" value="" class="rich-combobox-font rich-combobox-button-background rich-combobox-button"/>
<input id="comboboxButton#{clientId}" readonly="true" disabled="#{disabled}" type="text" value="" style="#{buttonStyle}"
class="rich-combobox-font-disabled rich-combobox-button-icon-disabled rich-combobox-button #{buttonDisabledClass}"
- onmousedown="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-pressed-background rich-combobox-button'; this.className='rich-combobox-button rich-combobox-button-pressed rich-combobox-font rich-combobox-button-icon rich-combobox-button-hovered';"
- onmouseup="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-background rich-combobox-button'; this.className='rich-combobox-button rich-combobox-font rich-combobox-button-icon rich-combobox-button-hovered'"/>
+ onmousedown="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-pressed-background rich-combobox-button';"
+ onmouseup="document.getElementById('comboBoxButtonBG#{clientId}').className='rich-combobox-font rich-combobox-button-background rich-combobox-button';"/>
<input type="text" class="rich-combobox-strut rich-combobox-font" style="width:#{width}"/>
</div>
17 years
JBoss Rich Faces SVN: r5336 - trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-01-14 03:54:30 -0500 (Mon, 14 Jan 2008)
New Revision: 5336
Modified:
trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
fix hover button behavior
Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-12 20:24:42 UTC (rev 5335)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-01-14 08:54:30 UTC (rev 5336)
@@ -253,7 +253,7 @@
},
doActive : function() {
- this.button.className = this.classes.BUTTON.CLASSES.ACTIVE;
+ this.button.className = this.classes.BUTTON.CLASSES.ACTIVE + " " + this.classes.BUTTON.CLASSES.HOVERED;
this.field.className = this.classes.FIELD.CLASSES.ACTIVE;
this.buttonBG.className = this.classes.BUTTONBG.CLASSES.ACTIVE;
this.isDisabled = false;
17 years
JBoss Rich Faces SVN: r5335 - trunk/cdk/generator/src/main/resources/META-INF/templates12.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-12 15:24:42 -0500 (Sat, 12 Jan 2008)
New Revision: 5335
Modified:
trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm
Log:
http://jira.jboss.com/jira/browse/RF-1818
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2008-01-12 20:24:37 UTC (rev 5334)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2008-01-12 20:24:42 UTC (rev 5335)
@@ -40,12 +40,6 @@
${component.simpleClassName} comp = (${component.simpleClassName}) component;
#foreach( $prop in $component.properties )
#if( !$prop.existintag && !$prop.hidden)
- #if(!$prop.el)
- if(null != this._${prop.name} && !this._${prop.name}.isLiteralText()){
- throw new IllegalArgumentException("Component ${component.name} with Id " + component.getClientId(getFacesContext()) +" not allowed EL expression for property ${prop.name}");
- }
- #end
-
#if($prop.elonly)
if(null != this._${prop.name} && this._${prop.name}.isLiteralText()){
throw new IllegalArgumentException("Component ${component.name} with Id " + component.getClientId(getFacesContext()) +" allows only EL expressions for property ${prop.name}");
@@ -84,6 +78,7 @@
((${component.simpleClassName})component).${prop.setterName}(this._${prop.name});
}
#else
+ #if ($prop.el)
if (this._${prop.name} != null) {
if (this._${prop.name}.isLiteralText()) {
try {
@@ -111,6 +106,17 @@
component.setValueExpression("${prop.name}", this._${prop.name});
}
}
+ #else
+ #if (!${prop.simpleType})
+ if (this._${prop.name} != null) {
+ #end
+
+ comp.${prop.setterName}(this._${prop.name});
+
+ #if (!${prop.simpleType})
+ }
+ #end
+ #end
#end
#end
#end
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm 2008-01-12 20:24:37 UTC (rev 5334)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm 2008-01-12 20:24:42 UTC (rev 5335)
@@ -21,6 +21,7 @@
#end
#else
<rtexprvalue>false</rtexprvalue>
+ <type>${prop.classname}</type>
#end
</attribute>
#if( $prop.alias )
17 years