Author: vmolotkov
Date: 2007-11-22 13:58:38 -0500 (Thu, 22 Nov 2007)
New Revision: 4210
Modified:
branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
Log:
controls for shuttle
Modified:
branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
===================================================================
---
branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2007-11-22
18:23:14 UTC (rev 4209)
+++
branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2007-11-22
18:58:38 UTC (rev 4210)
@@ -11,16 +11,16 @@
this.sourceList = sourceList;
this.controlList = new Array();
- this.initControlList(controlIds);
+ this.initControlList(clientId, controlIds);
},
- initControlList : function(ids) {
+ initControlList : function(clientId, ids) {
for (var i = 0; i < ids.length; i++) {
var id = ids[i];
- var node = document.getElementById(clientId + id[0]);
- var disNode = document.getElementById(clientId + id[1]);
+ var node = $(clientId + id[0]);
+ var disNode = $(clientId + id[1]);
if (node && disNode) {
- Shuttle.addClickListener(node,
Richfaces.ListShuttle.HANDLERS[id[0]].bindAsEventListener(this));
+ node.observe("click",
Richfaces.ListShuttle.HANDLERS[id[0]].bindAsEventListener(this));
this.controlList[i] = new Control(node, disNode, false, false, id[0]);
}
}
Modified:
branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
---
branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-11-22
18:23:14 UTC (rev 4209)
+++
branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-11-22
18:58:38 UTC (rev 4210)
@@ -29,7 +29,7 @@
<table id="#{clientId}">
<tr>
<td>
- <div style="display:inline;" id="#{clientId}sourceList"
x:passThruWithExclusions="id,style">
+ <div id="#{clientId}sourceList"
x:passThruWithExclusions="id">
<input id="#{clientId}focusKeeper" type="button"
value="" style="width: 1px; position: absolute; left: -32767px;"
name="focusKeeper"/>
<input id="#{clientId}valueKeeper" type="hidden"
name="#{clientId}" value="#{component.submittedString}"/>
@@ -63,17 +63,17 @@
</div>
</td>
<td>
- <a id="#{clientId}copy" href="#">copy</a>
- <a id="#{clientId}disCopy" href="#">dcopy</a>
- <a id="#{clientId}copyAll" href="#">copyAll</a>
- <a id="#{clientId}disCopyAll" href="#">dcopyAll</a>
- <a id="#{clientId}remove" href="#">remove</a>
- <a id="#{clientId}disRemove" href="#">dremove</a>
- <a id="#{clientId}removeAll" href="#">removeAll</a>
+ <a id="#{clientId}copy"
href="#">copy</a><br/>
+ <a id="#{clientId}disCopy"
href="#">dcopy</a><br/>
+ <a id="#{clientId}copyAll"
href="#">copyAll</a><br/>
+ <a id="#{clientId}disCopyAll"
href="#">dcopyAll</a><br/>
+ <a id="#{clientId}remove"
href="#">remove</a><br/>
+ <a id="#{clientId}disRemove"
href="#">dremove</a><br/>
+ <a id="#{clientId}removeAll"
href="#">removeAll</a><br/>
<a id="#{clientId}disRemoveAll"
href="#">dremoveAll</a>
</td>
<td>
- <div id="#{clientId}targetList" style="display:inline-block;"
x:passThruWithExclusions="id,style">
+ <div id="#{clientId}targetList"
x:passThruWithExclusions="id">
<input id="#{clientId}tlFocusKeeper" type="button"
value="" style="width: 1px; position: absolute; left: -32767px;"
name="focusKeeper"/>
<input id="#{clientId}tlValueKeeper" type="hidden"
name="#{clientId}" value="#{component.submittedString}"/>
@@ -103,14 +103,14 @@
</td>
<td class="ol_center_button_col_valign">
<div class="ol_button_layout">
- <a id="#{clientId}first" href="#">top</a>
- <a id="#{clientId}disfirst"
href="#">disTop</a>
- <a id="#{clientId}up" href="#">up</a>
- <a id="#{clientId}disUp" href="#">disUp</a>
- <a id="#{clientId}down" href="#">down</a>
- <a id="#{clientId}disDown"
href="#">disDown</a>
- <a id="#{clientId}last" href="#">bottom</a>
- <a id="#{clientId}dislast"
href="#">disBottom</a>
+ <a id="#{clientId}targetListfirst"
href="#">top</a><br/>
+ <a id="#{clientId}targetListdisfirst"
href="#">disTop</a><br/>
+ <a id="#{clientId}targetListup"
href="#">up</a><br/>
+ <a id="#{clientId}targetListdisup"
href="#">disUp</a><br/>
+ <a id="#{clientId}targetListdown"
href="#">down</a><br/>
+ <a id="#{clientId}targetListdisdown"
href="#">disDown</a><br/>
+ <a id="#{clientId}targetListlast"
href="#">bottom</a><br/>
+ <a id="#{clientId}targetListdislast"
href="#">disBottom</a>
</div>
</td>
</tr>
@@ -132,10 +132,11 @@
document.body.onselectstart = function() {return false;};
document.body.className = "body";
function init() {
- var cotrolsIdPrefix = [['copy', 'disCopy'], ['copyAll',
'disCopyAll'], ['remove', 'disRemove'],
['removeAll','disRemoveAll']];
- var listShuttle = new Richfaces.ListShuttle(new
Richfaces.OrderingList('#{cId}targetList', '#{cId}internal_tab',
'#{cId}internal_header_tab', '#{cId}focusKeeper',
'#{cId}valueKeeper', cotrolsIdPrefix, '#{cId}sortLabel', function()
{#{component.attributes['onorderchanged']}}),
- new Richfaces.ListBase('#{cId}sourceList',
'#{cId}tlInternal_tab', '#{cId}tlInternal_header_tab',
'#{cId}tlFocusKeeper', '#{cId}tlValueKeeper', cotrolsIdPrefix,
'#{cId}tlSortLabel', function()
{#{component.attributes['onorderchanged']}}),
- "#{cId}", cotrolsIdPrefix);
+ var cotrolsIdPrefix = [['up', 'disup'], ['down',
'disdown'], ['last', 'dislast'],
['first','disfirst']];
+ var listShuttleCotrolsIdPrefix = [['copy', 'disCopy'],
['copyAll', 'disCopyAll'], ['remove', 'disRemove'],
['removeAll','disRemoveAll']];
+ var listShuttle = new Richfaces.ListShuttle(new
Richfaces.OrderingList('#{cId}targetList', '#{cId}tlInternal_tab',
'#{cId}tlInternal_header_tab', '#{cId}tlFocusKeeper',
'#{cId}tlValueKeeper', cotrolsIdPrefix, '#{cId}sortLabel', function()
{#{component.attributes['onorderchanged']}}),
+ new Richfaces.ListBase('#{cId}sourceList',
'#{cId}internal_tab', '#{cId}internal_header_tab',
'#{cId}focusKeeper', '#{cId}valueKeeper'),
+ "#{cId}", listShuttleCotrolsIdPrefix);
var sourceLayoutManager = new LayoutManager('#{cId}internal_header_tab',
'#{cId}internal_tab');
var targetLayoutManager = new LayoutManager('#{cId}tlInternal_header_tab',
'#{cId}tlInternal_tab');
sourceLayoutManager.widthSynchronization();