dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16205
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6103: Use jQuery methods insteads of Request object in dhis-web-commons-resources.
------------------------------------------------------------
revno: 6103
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-02-24 16:02:52 +0700
message:
Use jQuery methods insteads of Request object in dhis-web-commons-resources.
modified:
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/updateUserAccountForm.js
dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/updateUserAccountForm.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/updateUserAccountForm.js 2011-10-24 15:45:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/useraccount/updateUserAccountForm.js 2012-02-24 09:02:52 +0000
@@ -21,23 +21,20 @@
function updateUser()
{
- var request = new Request();
- request.setResponseTypeXML( 'xmlObject' );
- request.setCallbackSuccess( updateUserReceived );
-
- var params = "id=" + byId( 'id' ).value;
- params += "&oldPassword=" + byId( 'oldPassword' ).value;
- params += "&rawPassword=" + byId( 'rawPassword' ).value;
- params += "&retypePassword=" + byId( 'retypePassword' ).value;
- params += "&surname=" + byId( 'surname' ).value;
- params += "&firstName=" + byId( 'firstName' ).value;
- params += "&email=" + byId( 'email' ).value;
- params += "&phoneNumber=" + byId( 'phoneNumber' ).value;
- request.sendAsPost( params );
- request.send( 'updateUserAccount.action' );
-}
-
-function updateUserReceived( xmlObject )
-{
- setMessage( xmlObject.firstChild.nodeValue );
+ $.postUTF8( 'updateUserAccount.action',
+ {
+ id: getFieldValue( 'id' ),
+ oldPassword: getFieldValue( 'oldPassword' ),
+ rawPassword: getFieldValue( 'rawPassword' ),
+ retypePassword: getFieldValue( 'retypePassword' ),
+ surname: getFieldValue( 'surname' ),
+ firstName: getFieldValue( 'firstName' ),
+ email: getFieldValue( 'email' ),
+ phoneNumber: getFieldValue( 'phoneNumber' )
+ }
+ , function( xmlObject )
+ {
+ xmlObject = xmlObject.getElementsByTagName( 'message' )[0];
+ setMessage( xmlObject.firstChild.nodeValue );
+ } );
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2012-02-20 16:18:47 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/dhis-web-commons.xml 2012-02-24 09:02:52 +0000
@@ -831,10 +831,10 @@
</action>
<action name="updateUserAccount" class="org.hisp.dhis.useraccount.action.UpdateUserAccountAction">
- <result name="success" type="velocity">
+ <result name="success" type="velocity-xml">
/dhis-web-commons/useraccount/updateUserSuccess.vm
</result>
- <result name="input" type="velocity">
+ <result name="input" type="velocity-xml">
/dhis-web-commons/useraccount/updateUserInput.vm
</result>
</action>