You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2010/05/05 13:55:32 UTC

svn commit: r941263 - in /myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl: core/jsf_impl.js xhrCore/_xhrCoreAdapter.js

Author: werpu
Date: Wed May  5 11:55:32 2010
New Revision: 941263

URL: http://svn.apache.org/viewvc?rev=941263&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-2701

getViewState now works as expected.. why didnĀ“ the tck catch that one?


Modified:
    myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/jsf_impl.js
    myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_xhrCoreAdapter.js

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/jsf_impl.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/jsf_impl.js?rev=941263&r1=941262&r2=941263&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/jsf_impl.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/jsf_impl.js Wed May  5 11:55:32 2010
@@ -82,6 +82,9 @@ if (!myfaces._impl._util._LangUtils.exis
          *  typecheck assert!, we opt for strong typing here
          *  because it makes it easier to detect bugs
          */
+        if('undefined' != typeof formElement && null != formElement) {
+            formElement =  myfaces._impl._util._LangUtils.byId(formElement);
+        }
 
         if ('undefined' == typeof(formElement)
                 || null == formElement
@@ -90,7 +93,10 @@ if (!myfaces._impl._util._LangUtils.exis
                 || formElement.nodeName.toLowerCase() != "form") {
             throw new Error("jsf.viewState: param value not of type form!");
         }
-        return this._requestHandler.getViewState(formElement);
+
+        var ajaxUtils = new myfaces._impl.xhrCore._AjaxUtils(0);
+        return ajaxUtils.processUserEntries(null, null, null,formElement, null);
+
     };
 
     /**

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_xhrCoreAdapter.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_xhrCoreAdapter.js?rev=941263&r1=941262&r2=941263&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_xhrCoreAdapter.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_xhrCoreAdapter.js Wed May  5 11:55:32 2010
@@ -28,17 +28,6 @@ if (!myfaces._impl._util._LangUtils.exis
      */
     myfaces._impl.xhrCore._Ajax = function() {}
 
-    /**
-     * Spec. 13.3.1
-     * Collect and encode input elements.
-     * Additinoaly the hidden element javax.faces.ViewState
-     * @param {String} FORM_ELEMENT - Client-Id of Form-Element
-     * @return {String} - Concatenated String of the encoded input elements
-     * 			and javax.faces.ViewState element
-     */
-    myfaces._impl.xhrCore._Ajax.prototype.getViewState = function(FORM_ELEMENT) {
-        return myfaces._impl.xhrCore._AjaxRequestQueue.queue.m_request.getViewState();
-    }
 
 
     /**