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 Developer
Posts: 4
Registered: ‎11-04-2008
My Device: Not Specified

Browser Development

I need some advice...

my team developed website 3 years back using Microsoft Mobile Intranet Toolkit (.Net & C#) and we only support Blackberry and iPhone. On the intial launch we only supported Blackberry and had all the styles inline when we added iPhone support we used device templates and used external stylesheet.

We are developing a new website and was wondering whether I should use MMIT or just use .net, c# and develop website using XHTMl. is there any drawbacks to this approach? Has anyone developed mobile site using asp.net & C# and external stylesheets?  Will all Blackberry browsers/Bes servers support XTML and CSS? If not then is there any document which will provide me this information?

 

 

BlackBerry Development Advisor
Posts: 15,697
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Browser Development

Please see the BlackBerry Browser reference documentation for a listing of what HTML, CSS and JavaScript elements are supported by the various versions of the BlackBerry Browser.  They can be found here:

 

http://na.blackberry.com/eng/support/docs/subcategories/?userType=21&category=BlackBerry+Browser

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
New Developer
Posts: 3
Registered: ‎11-26-2008
My Device: Not Specified

Re: Browser Development

Hi Mark,

 

I'm looking for Javascript API documentation specifically for the Storm, so I'm assuming that's v4.7 which isn't out yet.  Is there an ETA on that documentation?

 

Specifically, I'm wondering if the v4.7 JS API supports some kind of callback for a change in orientation to portrait/landscape mode (like what the iPhone has).  BTW, it's great that v4.6 has a JS API location-based callback (UNLIKE the iPhone that DOESN'T have it).

 

thanks in advance, Chuck 

BlackBerry Development Advisor
Posts: 15,697
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Browser Development

The BlackBerry Browser on the BlackBerry storm does support JavaScript methods for orientations change.  You can use the window.onorientationchange method to be alerted when the devices is rotated and then the window.orientation method to get the current orientation.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
New Developer
Posts: 3
Registered: ‎11-26-2008
My Device: Not Specified

Re: Browser Development

Hi Mark,

 

Thanks for the reply.  Does it not work in the 9530 simulator?  It doesn't seem to be working for a test page I've set up:

 

http://www.smartscorecard.com/oobgolf/test/test.html

 

thanks in advance, Chuck 

New Developer
Posts: 1
Registered: ‎11-30-2008
My Device: Not Specified

Re: Browser Development

I haven't tried the simulator (just got the phone), but this snippet works fine on a real 9530:

 

if (window.blackberry) {
var orientations = [];
orientations[0] = "portrait";
orientations[90] = "landscape";
orientations[-90] = "landscape";

var output = document.getElementById("whatever");
output.value = orientations[window.orientation];

window.onorientationchange = function() {
output.value = orientations[window.orientation];
}
}

 

It looks like you have the tilt event in the body tag like onload though, haven't tried that.  If the above code works in the simulator (set a div or textbox to an id of 'whatever'), might have to hook in via script.  If not, then it's probably not implemented in the sim.

 

New Developer
New Developer
Posts: 3
Registered: ‎11-26-2008
My Device: Not Specified

Re: Browser Development

I took it out of the <body> element and it still doesn't seem to be working, so it looks like a simulator thing...
New Developer
Posts: 6
Registered: ‎01-15-2010
My Device: Storm
My Carrier: 900MHz GSM/GPRS networks

Re: Browser Development

Hi Mark,

 

Even i am also facing the same issue. I used your code to display the orientation but doesnt seem to work in the 9530 simulator. Please advise what can we do to find out the orientation on simulator as we dont have devices yet to test on. here is my code:

 

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML BASIC 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
<html xmlns="http://wwww3.org/1999/xhtml">
<head>
    <title>My Accounts</title>
    <meta name="HandheldFriendly" http-equiv="others" content="text"></meta>
    <link rel="stylesheet" type="text/css" href="css/global.css" />    
    <script>
        if (window.blackberry) {
    var orientations = [];
    orientations[0] = "portrait";
    orientations[90] = "landscape";
    orientations[-90] = "landscape";
    
    var output = document.getElementById("orientaton");
    output.value = orientations[window.orientation];
    
    window.onorientationchange = function() {
        output.value = orientations[window.orientation];
    }
}
    </script>
</head>
<body>
    
    <div id="container">
    <div id="orientaton"></div>
        <div id="header"><img src="images/logo.png" alt="logo" /></div>        
        <div class="homeHeading"><h1>My Accounts</h1></div>

        <table cellpadding="0" cellspacing="0" border="0" class="heading">
            
                <tr>
                    <th class="col1">Accounts</th>
                    <th class="col2">Balance</th>
                </tr>
            
        </table>
        <table cellpadding="0" cellspacing="0" border="0" class="details">
            
                <tr>
                    <td class="leftTopCorner"></td>
                    <td class="rightTopCorner"></td>
                </tr>
                <tr class="firstRow">
                    <td class="col1"><a href="#">Value Account 1234567</a></td>
                    <td class="col2"><a href="#" class="arrowRight">1,234.56</a></td>
                </tr>
                <tr>
                    <td class="col1"><a href="#">Value Account 1234567</a></td>
                    <td class="col2"><a href="#" class="arrowRight">1,234.56</a></td>
                </tr>
                <tr class="lastRow">
                    <td class="col1"><a href="#">Value Account 1234567</a></td>
                    <td class="col2"><a href="#" class="arrowRight">1,234.56</a></td>
                </tr>
                <tr>
                    <td class="leftBottomCorner"></td>
                    <td class="rightBottomCorner"></td>
                </tr>
            
        </table>
      
    </div>
</body>
</html>

 

 

Please advise.

Developer
Posts: 107
Registered: ‎09-25-2008
My Device: Not Specified

Re: Browser Development

I think you want to use output.innerHTML instead of output.value.