Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Member
Posts: 1
Registered: ‎07-28-2011
My Device: Tablet
My Carrier: developer

webworks application with no internet access

Hello. I have created one simple application which has this structure:

config.xml

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.3" rim:header="RIM-Widget:rim/widget">
  <name>Calculator</name>
  <description>Uses JavaScript and Rest server.  Supported on BlackBerry 6 and PlayBook.</description>
  <author rim:copyright="2010">n/a</author>
  <icon rim:hover="false" src="icon.png"/>
  <icon rim:hover="true" src="icon.png"/>
  <content src="index.html"/>
  <access uri="http://calc.mydomain.com/" subdomains="true">
  </access>
  <access uri="http://localhost/calculator/sending/sources/includes/" subdomains="true" />
  <access uri="http://calc.mydomain.com/sources/includes/" subdomains="true"/>
  <permission>access_internet</permission>
</widget>


My application consists of one simple calculator. Drop-down list with the operations and two fields for the operands. I send my data to the server using this JS:

var req = new XMLHttpRequest();
        var url = "http://calc.mydomain.com/sources/includes/server.php/" + Op1 + "/" + Op2 + "/" + Method;
        req.open("GET", url , /*async*/true);
        req.onreadystatechange = function() {
            if (req.readyState == 4) {
                var addrField = document.getElementById('txtResult');
                   var card = eval('(' + req.responseText + ')');
                   if (card.operationCode != 1) {
                       alert('Error[' + card.operationCode + '] ' + card.data);
                   } else {
                    addrField.value = "Error";
                   }


I can compile the application and install it on the virtual machine but it seems that it is not connecting the server.
Why my application is not retrieving results?

Developer
Posts: 70
Registered: ‎04-08-2011
My Device: BB 4 and BB 5.0
My Carrier: BB Curve

Re: webworks application with no internet access

run the mds instance "run.bat"