You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by aw...@apache.org on 2007/09/12 01:35:10 UTC

svn commit: r574727 - in /myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main: java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectManyShuttleRenderer.java javascript/META-INF/adf/jsLibs/Shuttle.js

Author: awiner
Date: Tue Sep 11 16:35:09 2007
New Revision: 574727

URL: http://svn.apache.org/viewvc?rev=574727&view=rev
Log:
TRINIDAD-678: Description Not Shown in TextArea for Select*Shuttle Components
- Fixed that and other JS errors that occurred when the shuttle or the shuttle + the form where
  in a naming container

Modified:
    myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectManyShuttleRenderer.java
    myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Shuttle.js

Modified: myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectManyShuttleRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectManyShuttleRenderer.java?rev=574727&r1=574726&r2=574727&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectManyShuttleRenderer.java (original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SelectManyShuttleRenderer.java Tue Sep 11 16:35:09 2007
@@ -393,16 +393,17 @@
     // FIXME: Make sure we don't NPE when not in form
 
     // Get JS-valid identifiers for ourselves
-    String formName = XhtmlUtils.getJSIdentifier(rc.getFormData().getName());
+    String formName = rc.getFormData().getName();
+    String jsFormName = XhtmlUtils.getJSIdentifier(formName);
     String jsClientId = XhtmlUtils.getJSIdentifier(clientId);
     
     // Add the reset call to the form as a whole
     StringBuilder funcCallBuffer = new StringBuilder(
                                                19 +
                                                formName.length() +
-                                               jsClientId.length());
+                                               clientId.length());
 
-    funcCallBuffer.append("TrShuttleProxy._resetItems('").append(jsClientId);
+    funcCallBuffer.append("TrShuttleProxy._resetItems('").append(clientId);
     funcCallBuffer.append("','").append(formName).append("');");
     FormRenderer.addResetCall(clientId, funcCallBuffer.toString());
 
@@ -410,11 +411,11 @@
     // And write out the "orig" script that retains knowledge of
     // the original state of the component
     rw.writeText( "window[\"_", null);
-    rw.writeText(formName, null);
+    rw.writeText(jsFormName, null);
     rw.writeText("_", null);
     rw.writeText(jsClientId, null);
     rw.writeText("_orig\"]=TrShuttleProxy._copyLists('", null);
-    rw.writeText(jsClientId, null);
+    rw.writeText(clientId, null);
     rw.writeText("','", null);
     rw.writeText(formName, null);
     rw.writeText("');", null);

Modified: myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Shuttle.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Shuttle.js?rev=574727&r1=574726&r2=574727&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Shuttle.js (original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/Shuttle.js Tue Sep 11 16:35:09 2007
@@ -561,8 +561,7 @@
   listName
 )
 {
-
-  var descArray = window[listName.replace(':','_') + '_desc'];
+  var descArray = window[listName.replace(/:/g,'_') + '_desc'];
   return descArray;
 
 }
@@ -631,7 +630,7 @@
   listName
 )
 {
-  var selected = window[listName.replace(':','_') + '_sel'];
+  var selected = window[listName.replace(/:/g,'_') + '_sel'];
   return selected;
 }