Naw, changing the binding context won't change the behavior of idx.  Marc
is correct, you should access idx directly.  Something [outside the scope
of your method] is, however, modifying the value of idx before the XHR
returns, or was in fact undefined to begin with.  (Look for code
side-effects around the method invocation?)

Perhaps make a copy of the value of idx just after the declaration of req,
and use it in the callback instead of idx?






On Mon, May 6, 2013 at 8:25 AM, franck34 <[email protected]> wrote:

> Try remove "this" in
>
> req.addListener("success", function(e) {
>  ....
> }, *this*);
>
>
> On Mon, May 6, 2013 at 5:22 PM, fei wang <[email protected]>wrote:
>
>> But  In my application, when I print 'idx' in inner function, I got
>> "undefined".
>> So I guess the parameter 'idx' in outer function cannot be accessed
>> straightly.
>>
>>
>> On Mon, May 6, 2013 at 10:45 PM, Marc Puts <
>> [email protected]> wrote:
>>
>>>  You can access idx straight away, no extra work required :)
>>>
>>>
>>> On 06-05-13 16:14, fei wang wrote:
>>>
>>>  Hi,
>>>
>>>  Any one can help me about accessing function parameter ?
>>>
>>>  I have the follow function.
>>>
>>>  requsetProject : function(pid, idx) {
>>>                     var req = new
>>> qx.io.request.Xhr("/hrm/services/ActionServlet2", "POST");
>>>  req.setRequestData({
>>>         'class' : 'ProjectDAO',
>>>         'method' : 'queryProject',
>>>         'args' : "{\"pid\" : \"" + pid + "\"}"
>>>     });
>>>  req.addListener("success", function(e) {
>>>  var req = e.getTarget();
>>>  var str = req.getResponse();
>>>   *// My Question is:*
>>> * // in here, how to access the parameter 'idx' in outer function*
>>>  }, this);
>>>  req.send();
>>> }
>>>
>>>  Thanks in advance!
>>> Wang Fei
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
>>> Get 100% visibility into your production application - at no cost.
>>> Code-level diagnostics for performance bottlenecks with <2% overhead
>>> Download for free and get started troubleshooting in 
>>> minutes.http://p.sf.net/sfu/appdyn_d2d_ap1
>>>
>>>
>>>
>>> _______________________________________________
>>> qooxdoo-devel mailing 
>>> [email protected]https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
>>> Get 100% visibility into your production application - at no cost.
>>> Code-level diagnostics for performance bottlenecks with <2% overhead
>>> Download for free and get started troubleshooting in minutes.
>>> http://p.sf.net/sfu/appdyn_d2d_ap1
>>> _______________________________________________
>>> qooxdoo-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
>> Get 100% visibility into your production application - at no cost.
>> Code-level diagnostics for performance bottlenecks with <2% overhead
>> Download for free and get started troubleshooting in minutes.
>> http://p.sf.net/sfu/appdyn_d2d_ap1
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>
>
> ------------------------------------------------------------------------------
> Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
> Get 100% visibility into your production application - at no cost.
> Code-level diagnostics for performance bottlenecks with <2% overhead
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap1
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to