Author: abelevich
Date: 2008-09-26 11:03:34 -0400 (Fri, 26 Sep 2008)
New Revision: 10582
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4280
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
---
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-09-26
15:03:07 UTC (rev 10581)
+++
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-09-26
15:03:34 UTC (rev 10582)
@@ -1,9 +1,9 @@
if(!window.Richfaces) window.Richfaces = {};
Richfaces.InplaceSelect = Class.create(Richfaces.InplaceInput, {
- initialize : function($super, listObj, clientId, temValueKeepId, valueKeepId, tabberId,
attributes, events, classes, barParams, buttonId) {
+ initialize : function($super, listObj, clientId, temValueKeepId, valueKeepId, tabberId,
attributes, events, userStyles, commonStyles, barParams, buttonId) {
this.button = $(buttonId);
this.comboList = listObj;
- $super(clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, classes,
barParams);
+ $super(clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, userStyles,
commonStyles, barParams);
this.clickOnBar = false;
this.inplaceSelect = $(clientId);
this.inplaceSelect.component = this;
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
===================================================================
---
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-09-26
15:03:07 UTC (rev 10581)
+++
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-09-26
15:03:34 UTC (rev 10582)
@@ -1,7 +1,8 @@
if(!window.Richfaces) window.Richfaces = {};
Richfaces.InplaceSelectList = Class.create(Richfaces.ComboBoxList, {
- initialize : function($super, listId, parentListId, selectFirstOnUpdate, classes, width,
height, itemsText, onlistcall, fieldId, shadowId, showDelay, hideDelay, value) {
- $super(listId, parentListId, selectFirstOnUpdate, null, classes, width, height,
itemsText, onlistcall, fieldId, shadowId, showDelay, hideDelay);
+ initialize : function($super, listId, parentListId, selectFirstOnUpdate, userStyles,
commonStyles, width, height, itemsText, onlistcall, fieldId, shadowId, showDelay,
hideDelay, value) {
+ this.classes = Richfaces.mergeStyles(userStyles, commonStyles);
+ $super(listId, parentListId, selectFirstOnUpdate, null, this.classes, width, height,
itemsText, onlistcall, fieldId, shadowId, showDelay, hideDelay);
this.wrappingItems(value);
this.isListOpened = false;
},
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-09-26 15:03:07 UTC
(rev 10581)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-09-26 15:03:34 UTC
(rev 10582)
@@ -15,13 +15,14 @@
<h:styles>css/inplaceselect.xcss</h:styles>
<h:scripts>
- new org.ajax4jsf.javascript.PrototypeScript(),
+ new org.ajax4jsf.javascript.PrototypeScript() ,
/org/richfaces/renderkit/html/scripts/jquery/jquery.js,
- scripts/comboboxUtils.js,
- scripts/combolist.js,
- scripts/inplaceinput.js,
+ scripts/comboboxUtils.js ,
+ scripts/combolist.js ,
+ scripts/inplaceinput.js ,
scripts/inplaceselectlist.js,
scripts/inplaceselect.js,
+ scripts/inplaceselectstyles.js,
/org/richfaces/renderkit/html/scripts/utils.js
</h:scripts>
@@ -200,43 +201,44 @@
</div>
</div>
<script type="text/javascript">
- Richfaces.InplaceSelect.CLASSES = {
- COMBO_LIST : {
- LIST : {CLASSES :{ACTIVE : "rich-inplace-select-list-scroll
rich-inplace-select-list-decoration rich-inplace-select-list-position #{listClass}"
- }
- },
- ITEM : {NORMAL : "rich-inplace-select-item rich-inplace-select-font
#{itemClass}",
- SELECTED : 'rich-inplace-select-item rich-inplace-select-font
rich-inplace-select-selected-item #{itemSelectedClass}'
- }
- },
- COMPONENT : {CHANGED : {NORMAL : 'rich-inplace-select rich-inplace-select-view
rich-inplace-select-changed #{component.attributes["changedClass"]}',
HOVERED : 'rich-inplace-select-changed-hover
#{component.attributes["changedHoverClass"]}'},
- VIEW : {NORMAL : 'rich-inplace-select rich-inplace-select-view
#{component.attributes["viewClass"]}', HOVERED :
'rich-inplace-select-view-hover
#{component.attributes["viewHoverClass"]}'},
- EDITABLE : 'rich-inplace-select rich-inplace-select-view
rich-inplace-select-edit #{component.attributes["editClass"]}'
- }
+
+
+ var inplaceSelectUserStyles = {
+
+ combolist: {
+ list: { classes: {active:'#{listClass}'}},
+ item: { normal:'#{itemClass}', selected:'#{itemSelectedClass}'}
+ },
+
+ component: {
+ changed
:{normal:'#{component.attributes["changedClass"]}',hovered:'#{component.attributes["changedHoverClass"]}'},
+ view :
{normal:'#{component.attributes["viewClass"]}',hovered:'#{component.attributes["viewHoverClass"]}'},
+ editable:'#{component.attributes["editClass"]}'
+ }
};
- new Richfaces.InplaceSelect(new
Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}',
true,
- Richfaces.InplaceSelect.CLASSES.COMBO_LIST,
'#{component.attributes["listWidth"]}',
'#{component.attributes["listHeight"]}',
#{this:getItemsTextAsJSArray(context, component,items)}, null,
- '#{clientId}inplaceTmpValue',
'shadow#{clientId}', 0, 0, #{encodedFieldValue}),
- '#{clientId}', '#{clientId}inplaceTmpValue',
- '#{clientId}inplaceValue', '#{clientId}tabber',
- {defaultLabel :
'#{component.attributes["defaultLabel"]}',
- showControls : #{component.attributes["showControls"]},
- editEvent : '#{component.attributes["editEvent"]}',
- verticalPosition :
'#{component.attributes["controlsVerticalPosition"]}',
- horizontalPosition :
'#{component.attributes["controlsHorizontalPosition"]}',
- inputWidth :
'#{component.attributes["selectWidth"]}',
- minInputWidth :
'#{component.attributes["minSelectWidth"]}',
- maxInputWidth :
'#{component.attributes["maxSelectWidth"]}',
- openOnEdit: #{component.attributes["openOnEdit"]},
- closeOnSelect: true},
- {oneditactivation : #{this:getAsEventHandler(context, component,
"oneditactivation")},
- onviewactivation : #{this:getAsEventHandler(context, component,
"onviewactivation")},
- oneditactivated : #{this:getAsEventHandler(context, component,
"oneditactivated")},
- onviewactivated : #{this:getAsEventHandler(context, component,
"onviewactivated")},
- onchange : #{this:getAsEventHandler(context, component,
"onchange")}},
- Richfaces.InplaceSelect.CLASSES,
- ['#{clientId}bar', '#{clientId}ok',
'#{clientId}cancel', '#{clientId}buttons',
'#{clientId}btns_shadow'], '#{clientId}inselArrow');
+ new Richfaces.InplaceSelect(new
Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}',
true,
+ inplaceSelectUserStyles.combolist,
Richfaces.InplaceSelect.classes.combolist,
'#{component.attributes["listWidth"]}',
'#{component.attributes["listHeight"]}',
#{this:getItemsTextAsJSArray(context, component,items)}, null,
+ '#{clientId}inplaceTmpValue', 'shadow#{clientId}', 0, 0,
#{encodedFieldValue}),
+ '#{clientId}', '#{clientId}inplaceTmpValue',
+ '#{clientId}inplaceValue', '#{clientId}tabber',
+ {defaultLabel :
'#{component.attributes["defaultLabel"]}',
+ showControls : #{component.attributes["showControls"]},
+ editEvent : '#{component.attributes["editEvent"]}',
+ verticalPosition :
'#{component.attributes["controlsVerticalPosition"]}',
+ horizontalPosition :
'#{component.attributes["controlsHorizontalPosition"]}',
+ inputWidth : '#{component.attributes["selectWidth"]}',
+ minInputWidth :
'#{component.attributes["minSelectWidth"]}',
+ maxInputWidth :
'#{component.attributes["maxSelectWidth"]}',
+ openOnEdit: #{component.attributes["openOnEdit"]},
+ closeOnSelect: true},
+ {oneditactivation : #{this:getAsEventHandler(context, component,
"oneditactivation")},
+ onviewactivation : #{this:getAsEventHandler(context, component,
"onviewactivation")},
+ oneditactivated : #{this:getAsEventHandler(context, component,
"oneditactivated")},
+ onviewactivated : #{this:getAsEventHandler(context, component,
"onviewactivated")},
+ onchange : #{this:getAsEventHandler(context, component,
"onchange")}},
+ inplaceSelectUserStyles, Richfaces.InplaceSelect.classes,
+ ['#{clientId}bar', '#{clientId}ok',
'#{clientId}cancel', '#{clientId}buttons',
'#{clientId}btns_shadow'], '#{clientId}inselArrow');
</script>
</div>