在sencha touch中将变量从窗体传递到函数


Passing variables from a form to a function in sencha touch

我正在登录页面上使用sencha touch,我目前有一个将这些参数传递给Web服务的功能:

function Authenticate(username, password, theCallBack)
{
method = "Authenticate";
parameters = "<username xsi:type='xsd:string'>username</username><password xsi:type='xsd:string'>password</password><date xsi:type='xsd:date'>2009-06-05 12:15:00</date>";
// $.mobile.showPageLoadingMsg();
edarah_getDataFromWebService(method, parameters, theCallBack);
}

我的问题是在这一行:

<username xsi:type='xsd:string'>username</username><password xsi:type='xsd:string'>password</password><date xsi:type='xsd:date'>2009-06-05 12:15:00</date>

输入参数(用户名、密码)以纯字符串的形式传递给Web服务,我希望它们作为变量传递,这样当用户输入字符串时,这些变量包含用户键入的内容(这些参数的值取自Web表单,并作为参数输入到该函数中)。

当我输入与数据库中的条目匹配的用户名和密码时,如下所示:

<username xsi:type='xsd:string'>user123</username><password xsi:type='xsd:string'>1234</password><date xsi:type='xsd:date'>2009-06-05 12:15:00</date>

它起作用了,我得到了想要的响应,但我无法将它们作为字符串输入。有人知道怎么做吗?

这比我想象的要简单得多,显然我因为缺乏经验而无法做到这一点,下面是解决方案:

parameters = "<username xsi:type='xsd:string'>" + username + "</username><password xsi:type='xsd:string'>" + password + "</password><date xsi:type='xsd:date'>" + datetime + "</date>"