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
blackwind
Posts: 23
Registered: ‎02-10-2011
My Device: PlayBook
Accepted Solution

Forcing landscape mode with WebWorks

To force an application into landscape mode, the following must be added to <initialWindow> in your *-app.xml file:

<autoOrients>false</autoOrients>

<aspectRatio>landscape</aspectRatio>

If I create an *-app.xml for my WebWorks project, however, it's discarded by the compiler. To date, I've been opening my .bar file after compilation, extracting the *-app.xml the compiler creates, editing it, and updating the archive, but I suspect this won't be an option when it comes time to sign my applications.

What other options do I have?

/bw
Please use plain text.
Developer
Accoductions
Posts: 42
Registered: ‎01-18-2011
My Device: PlayBook

Re: Forcing landscape mode with WebWorks

Bump, anyone have a solution for this?
Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Forcing landscape mode with WebWorks

Hi everyone,

 

We've actually been having discussions about this functionality today.. We are looking at a couple of solutions that would be built into the software.

 

For right now you may be able to try the following... (I haven't tested this one yet)

 

If you go to the "bbwp\AirAppTemplates\src" directory where you installed the WebWorks for PlayBook SDK you will find a file called WebWorksAppTemplate-app.xml

 

I believe this is the file we use as a template and then replace specific areas with information from your config.xml file.

 

Try making these alterations to this file and they may stick for you.  Also note that making changes in here will affect all apps that you build with the SDK.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Developer
blackwind
Posts: 23
Registered: ‎02-10-2011
My Device: PlayBook

Re: Forcing landscape mode with WebWorks

Worked like a charm. Many thanks, Tim!

/bw
Please use plain text.
Developer
second
Posts: 20
Registered: ‎03-11-2011
My Device: Not Specified

Re: Forcing landscape mode with WebWorks

Hi Tim,

 

Is there any update about supporting this without having to modify the app template?

 

thanks,

second

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

Re: Forcing landscape mode with WebWorks

No update yet. It's on the list to do but has not yet made its way into the top priority items to be worked on.
Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Developer
ryanmc
Posts: 71
Registered: ‎02-04-2011
My Device: Blackberry Bold & Pearl

Re: Forcing landscape mode with WebWorks

Has anyone tried to force portrait mode? I get about two thirds of the screen usable with the last third being light grey. 

 

I've been away from development for a few weeks because of an earthquake and was hoping that there had been alot of progress on a few of these bugs. Its quite frustrating when you are already far behind schedual to come across these sorts of issues - of course the extension of the offer was a godsend.

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

Re: Forcing landscape mode with WebWorks

I'm assuming you are referring to the PlayBook... If so, the PlayBook simulator does not yet support showing application's in portrait mode only yet.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
New Developer
blackwind
Posts: 23
Registered: ‎02-10-2011
My Device: PlayBook

Re: Forcing landscape mode with WebWorks

This solution no longer works as of SDK v2.0.0.4. Compiler reports:

 

[INFO]                  Packaging the bar file
Error: AIR validation failed
error 103: application.initialWindow.autoOrients is an unexpected element/attribute

Suggestions?

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

Re: Forcing landscape mode with WebWorks

It is now a supported feature of the config.xml file for your WebWorks application.  If you change it in your config.xml it should work fine.

 

http://docs.blackberry.com/en/developers/deliverables/27280/Widget_element_834671_11.jsp#RIM_orienta...

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.