Created
November 30, 2010 22:23
-
-
Save MikeGrace/722536 to your computer and use it in GitHub Desktop.
answer for http://stackoverflow.com/questions/4230055/process-client-side-array-in-krl-raised-to-kynetx-app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruleset a60x442 { | |
meta { | |
name "array-passing-test" | |
description << | |
array-passing-test | |
>> | |
author "Mike Grace" | |
logging on | |
} | |
rule start_your_engines { | |
select when pageview ".*" | |
{ | |
notify("Running","...sending array to KNS") with sticky = true; | |
emit <| | |
app = KOBJ.get_application("a60x442"); | |
var numbers = [1,2,3,4,5]; | |
nums = JSON.stringify(numbers); | |
app.raise_event("process_array", {"numbers":nums}); | |
$K("div.KOBJ_message").append("<br/>"+nums); | |
|>; | |
} | |
} | |
rule process_array { | |
select when web process_array | |
foreach event:param("numbers").decode() setting (number) | |
{ | |
notify("number",number) with sticky = true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment