Embedded Javascript using Text Control Box on a form

breff

Member
Looking for some ideas/help.

Have a requirement to play a beep sound on a form at certain points when certain conditions are met.

Somebody has pointed me in the direction of placing a javascript in a text block control to accomplish this. So i have added the following code to a text block control to call a .wav file.

< script language="javascript">

<bgsound src="C:\WINDOWS\MEDIA\TADA.WAV" loop="1">

</script>

This works on my local fat client (ie plays the beep)
but when i run on the local web client i get no beep sound

Anyone used javascript in a form before? Any javascript experts out there?

BH

JD Edwards EnterpriseOne 8.12 with 8.96 toolset on win2k3 server]
 
It is not recomended due to performance issue.




--
Regards,
Nitin Shetye
 
Thanks for reply nitin, is there any other method of doing this that you can think of?

Many thanks,

BH
 
I'm back do you want me to launch the WAS express Supplements on the GEN
machine.
Michael Kenney
IT Services
University of Windsor
(519)253-3000 ext 2754



From:
breff <[email protected]>
To:
[email protected]
Date:
01/15/2009 12:49 PM
Subject:
Re: Embedded Javascript using Text Control Box on a form
Sent by:
[email protected]



Thanks for reply nitin, is there any other method of doing this that you
can think of?

Many thanks,

BH
 
What performance issue? From which guide to you read this 'recommendation'?


Breff,

What's your purpose in playing sounds? To do what you're attempting requires signoff from CNC and possibly management people because you will have to move a foreign file into the tools/web directories.
 
I can give you one easy one. We have an application for processing returns, a high volume low value transactions which runs in a headerless detail. We get an audible beep from the scanner but that doesn't mean the grid row functioned properly. Being able to issue an audible signal from grid row exit rather than the scanner would be an ideal use of a sound from an event.
 
Whippingboy,

Its a similiar requirement to what Kylepyro has mentioned. We have a weighing scales interface and are also using scanners. At various points I would like to trigger an audible sound.

There is no problem with the CNC sign-off etc its just I cant get the embedded javascript to run on a web client.

Any ideas?

Thanks

Breff
 
You have to consider the web client as something of a 'fish tank'. In most regards you're allowed to look into the 'tank' and maybe trick the fish into moving by pretending to feed them, but it is a little world to itself. The world of the tank doesn't interact with the world of your computer. Believe me, as much as you'd like to think that the fish can come out and play with you, they should STAY IN THE TANK. That was a hard lesson learned, let me tell you. Save yourself the heartache and LEAVE THE FISH IN THE WATER!

In reality, the 'tank' is the web server and since it is on some far away computer(assuming it is indeed far away) you shouldn't be telling it to use files on your local machine. You should be placing all the resources on the server and telling it to move them to your browser. For security purposes Javascript really isn't supposed to be talking to files on your PC anyway.

Now, look at the source code of a simple JDE screen. I'm talking about the HTML source. The JDE directory is the common repository for all the files referenced in the source.

In demo jr 8.12 this is the jde directory:

C:\E812\system\OC4J\j2ee\home\applications\webclient.ear\webclient


You'll have to get the CNC folks to handle putting your sound file in the right place on the real server (in ALL the environs). A new Custom directory sounds good to me.

Now, writing a new js file and referencing that file in a text block control you can write as much script as you want and play your sound with it. Be careful with the textblock size- jde doesn't like big textblocks and will simply throw out whatever you type if it gets too big. Earlier versions of the tool liked even smaller blocks, so you'll have to experiment a bit. Oh, and kill all the 'new lines' in those blocks. Edit everything onto a single line with notepad, or something, before pasting it in.
 
Hi,
i had a simular problem that the web client has to interact with the pc where the browser is running. I have written a tool which is called E1RemoteServiceListener.
Basically it's a WIN32 app which is running in the background of your workstation and it waiting for HTTP requests on a specific port. In EnterpriseOne you can use the system function 'Go to Url' with the right paramater and this causes E1RemoteServiceListener to execute an app or a service or batch on the client machine. This could be used for example to play a wav file or do a simple beep.

More details can be found on:
www.e1itconsult.com/en/solutions

Let me know if you are interessted in this solution.
 
Back
Top