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
Visitor
Bhavya
Posts: 1
Registered: ‎03-24-2011
My Device: Playbook
My Carrier: none

Locking Orientation with the Playbook WebWorks Api

I've only seen ways to do this with the Blackberry API. How would I go about locking the orientation to, say, landscape, with the Playbook API?

 

Thanks in advance.

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Locking Orientation with the Playbook WebWorks Api

I was just a part of the review for this functionality the other day :smileyhappy:

 

It will be part of one of the next WebWorks for PlayBook SDK releases (it is not included in Beta 3).. 

 

It will be in form of an optional config.xml entry to lock the orientation to either landscape or portrait.  It will not however allow you to turn on/off the lock dynamically in its first release.  It will be an application wide setting.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Developer
Alocaly
Posts: 25
Registered: ‎03-27-2011
My Device: developer
My Carrier: Free Mobile

Re: Locking Orientation with the Playbook WebWorks Api

And the trick described in this forum thread :

http://supportforums.blackberry.com/t5/Web-Development/Forcing-landscape-mode-with-WebWorks/m-p/8101...

 

Modifying some of the SDK files...

 

Does it works ?

 

 

Emmanuel

Please use plain text.
Developer
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: Locking Orientation with the Playbook WebWorks Api

It's not working in the new SDK. Still have to do the trick thing it seems.

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Please use plain text.
Developer
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: Locking Orientation with the Playbook WebWorks Api

Nevermind, it is working :smileywink:

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Please use plain text.
New Developer
redbutt
Posts: 37
Registered: ‎03-02-2009
My Device: Bold 9700
My Carrier: TMO

Re: Locking Orientation with the Playbook WebWorks Api

I just tried it, and it's not working with the latest WebWorks SDK. You get an error saying that <autoOrients>false</autoOrients> is an unexpected value.
Please use plain text.
Developer
djames_
Posts: 25
Registered: ‎04-04-2011
My Device: BlackBerry® PlayBook™
My Carrier: AT&T

Re: Locking Orientation with the Playbook WebWorks Api

I used this and it seemed to work. Try adding this to your config.xml

<rim:smileysurprised:rientation mode="auto"/>
Change to portrait or landscape.
Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Locking Orientation with the Playbook WebWorks Api

yup, support for orientation lock via the config.xml file was added in 2.0
Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Developer
redbutt
Posts: 37
Registered: ‎03-02-2009
My Device: Bold 9700
My Carrier: TMO

Re: Locking Orientation with the Playbook WebWorks Api

Yes...I just tried it and its working. Thanks. The docs are a bit hard to wade through sometimes on these updates because indexed links lead to older info.
Please use plain text.
New Developer
jjrohrer
Posts: 13
Registered: ‎10-19-2010
My Device: 9000
My Carrier: AT&T

Reality Check on Playbook orientation

Arghh, this is so not working for me.  I have a web works app that is only meant to run in Portrait mode, but whenever I launch my app, the simulator automatically flips to landscape and refuses to re-orient back to portrait (corner swipe is ignored).  

 

I feel like I've tried every permutation, trying to stumble upon the right configuration, but I would really use a helping hand.  Basically, it seems like this is what I should have in my config.xml file -- I'd really appreciate somebody pointing out where I am wrong:

 

 

My config.xml (for completeness)

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" 
	rim:header="RIM-Widget:rim/widget"
	version="1.0.3" 
	id="com.eleganttechnologies.quadratic"
	>
  <name>Quadratic</name>
  <description>Solve the quadratic equation on the PlayBook.</description>
  <author 
	rim:copyright="2011"
	email="support.bbpb.quadratic@eleganttechnologies.com"
	>Elegant Technologies, LLC</author>
  <rim:loadingScreen backgroundImage="background.png"
                     foregroundImage="cached_images/icon_1024x1024.png"
                     onLocalPageLoad="true">
        <rim:transitionEffect type="zoomIn"/>
  </rim:loadingScreen>

  <icon src="cached_images/icon_86x86.png"/>
  <content src="www/ProjQuadratic/playbookSkin/webapp.html"/>
	
  <Orientation mode="portrait"/>

</widget>

FYI: bbwp version 1.0.0.23

Simulator: 1.0.1.1630

Webworks downloaded on April 25, 2011

 

Thanks!,

JJ

 

Please use plain text.