Author |
Message |
08/10/2008 10:27:40
|
kretzler
Power User
Joined: 21/11/2007 13:00:57
Messages: 73
Location: Karlsruhe
Offline
|
Hello,
is it possbile to get a java object as 'resulttext' for a t:thjscall component?
the javascript function:
function ccGetLastError() {
var error = document.SCardApplet.scard.getLastError();
var errorCode = error.code;
var errorMsg = error.text;
var result = new Object();
result.callback = true;
result.returnvalue = xxx;
return result;
};
The return value from the applet is a java bean. It would be nice to pass this java bean to captain casa.
If this isnt possible I would return something like this
result.returnvalue = error.code + ';' + errorMsg;
and then split this string later.
Any other ideas?
Thanks,
Ralph
|
|
|
08/10/2008 10:56:16
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5535
Offline
|
Hi,
NOOOOO chance ;-)
Remember: the applet is inside the browser pages, the server processing on the server side. The only chance would be to serialize the object and re-serialize on server side - with problems when versions are not compatible etc.
So: serialization as csv-String, as you propose, is the better way. Or any other format (you may pass some XML as well...), but character/String based...
Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
09/10/2008 09:46:07
|
kretzler
Power User
Joined: 21/11/2007 13:00:57
Messages: 73
Location: Karlsruhe
Offline
|
Hi,
ok I thought that this isnt possible.
But to have only a String as a return value is a bit tricky. Is it possible to have two return values. (resulttext and resulttext[])
function ccGetCard() {
var result = new Object();
result.callback = true;
result.returnvalue = 'xxx';
result.returnvalue2 = new Array('a', 'b', 'c');
return result;
};
We use a Java Applet, so I have also 'java objects' within javascript and break down all java objects to a string is a bit tricky.
|
|
|
09/10/2008 16:50:22
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5535
Offline
|
...the question is when to end with what type of result can be pased.
I would really like to just say: there is one result string. Any information needs to be "serialized" into this string. If you need the code for simplifying e.g. CSV-conversion - please contact us.
...OK? (Sorry, I know it does not exactly match what you ask us to do...)
Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
10/10/2008 09:41:04
|
kretzler
Power User
Joined: 21/11/2007 13:00:57
Messages: 73
Location: Karlsruhe
Offline
|
Hello Björn,
ok, this is a point. We can also serialize all information into a string.
Thanks,
Ralph
|
|
|
10/10/2008 14:18:25
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5535
Offline
|
...thanks! Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
|