Scanner decodeEvent don't fire

Hi every body,

Trying to test the Scanner fonctionnality on the ET1 with RhoElements V2, my DecodeEvent never fire, i try the InventoryManagement project but i get the same problem,

just when i call Scanner.start it works fine, i don't want to use a soft start, the user must press the scan button.

i have tested the HolloScan which works fine with RhoElements 1.0.3.11, but in vain the same result, DecodeEvent don't fire.

my code is like this:

def enableScanner

      Scanner.decodeEvent = url_for(:action => :scannerEventListener)

      Scanner.enable

end

def scannerEventListener

      $scanResult = @params['data']

     WebView.execute_js("setFieldValue('result', " + $scanResult + ");")

end

is their any thing i am missing ? Why the same HolloScan.html works fine on RE1.0.3.11 and not on RE2 ? is their any thing to do in the config file ?

thanks.

Amit Kumar Khan...
Please use Alert.show_popup(

Please use Alert.show_popup("Scan Data "+$scanResult ) in place of WebView.execute_js function and see alert message shows the data or not? i have doubt on syntax of

WebView.execute_js function.use attached code snippet.

 

def enableScanner

Scanner.decodeEvent = url_for(:action => :mydecodeevent)

Scanner.enable

end

def mydecodeevent
     puts "In mydecodeevent" 
     scannerData = @params
    mydata = scannerData["data"]
    Alert.show_popup("Data:- "+mydata)
end

Thanks,

Amit

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Adel Sari
Hi Amit, I try your code but

Hi Amit,

I try your code but still not working, don't show the alert after scanning.

As i have mentioned, when i add Scanner.start after enabeling the scanner it works, and the WebView.execute_js("setFieldValue('result', " + $scanResult + ");") puts the data in the result field.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Nrusingha Chara...
Hello Adel,Please make sure

Hello Adel,

Please make sure you have disabled datawedge on ET1.

Thanks

Patro

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Adel Sari
Thanks Nrusingha, i have

Thanks Nrusingha, i have disabled the DataWedge and it works now.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Nrusingha Chara...
Please call your controller

Please call your controller function enableScanner with ajaxget from index.erb file

like

$.get('/app/path to function enableScanner'),

I think this should fix your issue.

Thanks.

Patro

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Adel Sari
Thanks for your reply, yes of

Thanks for your reply, yes of course i call my function this way: $.get('/app/ScannerModule/enableScanner', { });

but the DecodeEvent don't fire.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments