4.0 Example
The sample application
A sample application ships with the system. ClickToDial.html shows how standard HTML fields can be used to request the dial parameters from the user and to send them to the web component.
<!doctype html> <!-- The DOCTYPE declaration above will set the --> <!-- browser's rendering engine into --> <!-- "Standards Mode". Replacing this declaration --> <!-- with a "Quirks Mode" doctype is not supported. --> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!-- --> <!-- Any title is fine --> <!-- --> <title>Noojee Click for AJAX</title> <!-- --> <!-- This script loads your compiled module. --> <!-- If you add any GWT meta tags, they must --> <!-- be added before this line. --> <!-- --> <script type="text/javascript" src="/noojeeclick/noojeeclick/noojeeclick.nocache.js"></script> <script type="text/javascript"> var njClickDialParameters = { extension : "SIP/100", autoAnswerString : "Call-Info:\; answer-after=0" }; </script> </head> <!-- --> <!-- The body can have arbitrary html, or --> <!-- you can leave the body empty if you want --> <!-- to create a completely dynamic UI. --> <!-- --> <body> <!-- OPTIONAL: include this if you want history support --> <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position: absolute; width: 0; height: 0; border: 0"></iframe> <!-- RECOMMENDED if your web app will not function without JavaScript enabled --> <noscript> <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"> Your web browser must have JavaScript enabled in order for this application to display correctly.</div> </noscript> <h1>Noojee Click for AJAX</h1> <p>The Noojee Click for AJAX is a web service and as such is not intended to be accessed directly.</p> <p> <!-- These following shows a number with an associated dial button. --> <!-- You can format the button in anyway you want or even use a link. ---> <!-- The key component here is the 'onClick' hander which must ---> <!-- call njClickToDial --> Enter your test extension number in the form 'SIP/NNNN'<br> Extension: <input type="text" id = "extension"><br> <!-- The following shows how to dial a number which is contained in an input field. --> <span style="white-space: nowrap">Number To Dial: <input type="text" id = "number"> <input type="button" id="noojeeClick-btn" title="5551234" style="width: 16px; height: 14px; background: url('images/call-phone.png') 0 0 no-repeat; border: 0; padding: 0;" onClick="javascript:njClickDialParameters.extension = document.getElementById('extension').value;njClickToDial(document.getElementById('number').value);"> </span> </p> <p> <br> <!-- demonstrates a simple dial button --> Number to dial <span style="white-space: nowrap">5551234 <input type="button" id="noojeeClick-btn" title="5551234" style="width: 16px; height: 14px; background: url('images/call-phone.png') 0 0 no-repeat; border: 0; padding: 0;" onClick="javascript:njClickToDial('5551234');"> </span> </p> </body> </html>