Invoke Verb from script
creasysee
23 Aug 2012, 17:01Hello all.
I've a custom a JS function "showDialog" from external JS file:
JS code:
Function assigned to Verb "touch".
ASLX code:
After calling this function popup javascript alert displayed and waiting user action. After closing dialog by user js code from function showDialog calls function ASLEvent and function SendDialogResult has been invoked. Next I want to simulate the verb "aftertouch" of the object "object1". How can this be done?
Thanks.
I've a custom a JS function "showDialog" from external JS file:
JS code:
function showDialog(caption, text) {
//there show popup alert
...
ASLEvent("SendDialogResult", res);
}
Function assigned to Verb "touch".
ASLX code:
<object name="object1">
<inherit name="editor_object" />
<displayverbs>touch; aftertouch</displayverbs>
....
<touch type="script">
request (RunScript, "showDialog('" + object1.alias + "','there my text')")
</touch>
<aftertouch type="script">
if (DialogResult.value > 0) {
SetObjectFlagOn (object1, "answered")
}
</aftertouch>
</object>
...
<object name="DialogResult">
....
<value type="int">0</value>
</object>
...
<function name="SendDialogResult" parameters="data">
DialogResult.value = data
***** what there invoke Verb "aftertouch" of object "object1"? ****
</function>
After calling this function popup javascript alert displayed and waiting user action. After closing dialog by user js code from function showDialog calls function ASLEvent and function SendDialogResult has been invoked. Next I want to simulate the verb "aftertouch" of the object "object1". How can this be done?
Thanks.

Pertex
23 Aug 2012, 18:35You could try
But I think you could move this aftertouch script into the function SendDialogResult,too
HandleSingleCommand ("aftertouch object1")
But I think you could move this aftertouch script into the function SendDialogResult,too
creasysee
24 Aug 2012, 13:28Thanks, it works for me, but instead object name I use object alias:
If I use "aftertouch object1" I have exception "UnresolvedObject" and otput text "I can't see that." Using an alias works correctly.
Maybe it's some my bug... Although if searching by the alias works then the object is valid and searching by name shoud works also. This is strange.
<object name="object1">
<inherit name="editor_object" />
<alias>object1_alias</alias>
<displayverbs>touch; aftertouch</displayverbs>
....
HandleSingleCommand ("aftertouch object1_alias")
If I use "aftertouch object1" I have exception "UnresolvedObject" and otput text "I can't see that." Using an alias works correctly.
Maybe it's some my bug... Although if searching by the alias works then the object is valid and searching by name shoud works also. This is strange.