Hey,
I can't say enough how valuable this package is for my app!! Thank you!!

Quick question. I have to access some local variables in my method callbacks. Is there a way to pass them in or set the scope so that multiple callbacks will get the values passed to them? I couldn't see how this can be done.

I use a loop and need to pass the loop value at the time of each invocation (so it stays fixed), so I can't just reference the variable directly.

Hey,
I can't say enough how valuable this package is for my app!! Thank you!!

Thanks, I never get tired of hearing such things...

Quick question. I have to access some local variables in my method callbacks. Is there a way to pass them in or set the scope so that multiple callbacks will get the values passed to them? I couldn't see how this can be done.

I use a loop and need to pass the loop value at the time of each invocation (so it stays fixed), so I can't just reference the variable directly.

Hmmm. I'm not sure I understand what you really mean, so take the following answer/reflection with a bit of salt.

This seems a lot like the kind of thing you should coordinate on the server side, passing the information you want to share among calls to a stateful object *before* you invoke the methods that need to acccess the shared information.

Then, subsequent calls to methods, which should belong to that object, will have access to the shared data.
Or you could use the other mechanisms provided by DJN to access session/application data and store your temporary information there.

You might want to use a list to store the information per loop (list index=current loop index), so that the invoked methods receive the index and can access the data corresponding to the loop they are handling -needed because of asynchronicity...

But, of course, you need to make sure the methods are not invoked before the appropriate per-loop data is initialized. Not terribly difficult, though.

But, frankly, I'm not sure I see the whole context, so I might be misfiring. Could you provide us with more details?

this framework (the gson framework) transforms the Java Type automatically to a json object.
For example Hashmap will be a javascript object with key-value pairs.
a String array in Java will also be returned as a json String array and so on. There's no need to build a json object and then return it. The framework does the work..

result of Method: getAnyObject(){"tid":6,"action":"DemoClass","method":"getAnyObject","result":{"key":"value"},"type":"rpc"}

result of Method: getAnotherObject(){"tid":7,"action":"DemoClass","method":"getAnotherObject","result":{"key":["value 1","value 2"]},"type":"rpc"}result of Method: getLastObject(){"tid":8,"action":"DemoClass","method":"getLastObject","result":{"key":{"key":["value1","value2"]}},"type":"rpc"}

Hmmm. I'm not sure I understand what you really mean, so take the following answer/reflection with a bit of salt.

This seems a lot like the kind of thing you should coordinate on the server side, passing the information you want to share among calls to a stateful object *before* you invoke the methods that need to acccess the shared information.

Then, subsequent calls to methods, which should belong to that object, will have access to the shared data.
Or you could use the other mechanisms provided by DJN to access session/application data and store your temporary information there.

You might want to use a list to store the information per loop (list index=current loop index), so that the invoked methods receive the index and can access the data corresponding to the loop they are handling -needed because of asynchronicity...

But, of course, you need to make sure the methods are not invoked before the appropriate per-loop data is initialized. Not terribly difficult, though.

But, frankly, I'm not sure I see the whole context, so I might be misfiring. Could you provide us with more details?

Regards,

Hey there.

So let's say I want to kick off a method call on the client. I pass a few parameters and want to update some GUI objects when the callback is received. Since the method call is asynchronous, it goes out of scope from where it was called. If there was a way to add a scope or context with the method call, then my callbacks have direct access to javascript variables that the callback might need without having to store and fetch it another way.

Hi again,
When submitting forms, I am only getting the Name field, not the Value field for a form element (combo).

Is this something going on in directjngine? I have all the form parameters set for each field and the form has the correct values in the fields, but when received on the server, they are the "name" values of the field, not the "value" value.