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

Adobe AIR Development

Reply
Developer
abhi007tyagi
Posts: 225
Registered: ‎09-29-2010
My Device: Limited Edition Z10, Playbook

Few Issues with application/simulator

Hi,

 

There are few issues with my application.

Please help me to resolve these.

 

1. How to rotate the simulator to test landscape and portrait orientation?

2. How to make app only work in landscape mode and not in portrait mode?

3. I have a drop-down menu just above the submit button. problem is when I click the menu the drop-down list comes behind the Submit button and few of the options are not visible. Any way to overcome this?

4. Can I submit my app without code-sighning?

5. Is the free-playbook offer valid in India?

 

Thanks

Abhinav Tyagi

 

Blackberry Z10-Limited Edition
Blackberry Playbook (won in free playbook offer)
My Apps : pAinT, HealthMeter, Shoot
Please use plain text.
Developer
abhi007tyagi
Posts: 225
Registered: ‎09-29-2010
My Device: Limited Edition Z10, Playbook

Re: Few Issues with application/simulator

Got the answer to #2

 

Use following in appname-app.xml

<autoOrients>false</autoOrients><aspectRatio>landscape</aspectRatio>

 

 

Please help me in finding solutions for other Q.

 

Thanks

Abhinav

Blackberry Z10-Limited Edition
Blackberry Playbook (won in free playbook offer)
My Apps : pAinT, HealthMeter, Shoot
Please use plain text.
Developer
jffurlan
Posts: 1,003
Registered: ‎01-16-2011
My Device: PlayBook (sim)

Re: Few Issues with application/simulator

Q1: To rotate re simulator click the bottom right corner of the bezel and drag to the middle. If it doesn't rotate it's because your app is landscape only. Use this with caution though as there are bugs with it.

Q5: nothing has stated that the offer is invalid in India so I don't see why you wouldn't get one...
- If you like my response/post, or it helped you find an answer you were looking for, please provide a Kudo - white star to the bottom right of this post. -
- Please use the search bar at the top, or check out the PlayBook FAQ's for help getting started -
- Hockey DrillBook -
Please use plain text.
Developer
abhi007tyagi
Posts: 225
Registered: ‎09-29-2010
My Device: Limited Edition Z10, Playbook

Re: Few Issues with application/simulator

Thanks jffurlan,

 

I can now rotate the simulator... and also see the bugs

 

when I rotate and open my app, it opens correctly but small in size, but when I open my app and rotate, right half of my app goes missing!!! 

 

Are these issues related to Simulator or coding in my App?

 

Please help me resolving other issues as well.

 

Thanks

Abhinav Tyagi

Blackberry Z10-Limited Edition
Blackberry Playbook (won in free playbook offer)
My Apps : pAinT, HealthMeter, Shoot
Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Few Issues with application/simulator

In Reply to Question 3:

 

There are two ways of going about solving that issue:

 

One: Simply add the drop down menu after the submit button. that way the index of the drop down menu is always higher than that of the submit button. you can also always use the setChildIndex() method to set the index manually.

 

Two: If you are using containers, its a little more complicated. Since the order of your children objects is taken into account with the QNX containers, you would have to do a .layout() first and then use the setChildIndex() method on the dropdown menu and set it to an index that is higher than the submit button. the only problem with that is the next time you do the .layout() it will mess up the way everything looks due to the change of child order. so the workaround for that is to "reset" the child index of the drop down menu and then do the layout() method and then do the setChildIndex() method again to set the drop down's index to the a number higher than the submit button.

 

good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Few Issues with application/simulator

 


abhi007tyagi wrote:

Thanks jffurlan,

 

I can now rotate the simulator... and also see the bugs

 

when I rotate and open my app, it opens correctly but small in size, but when I open my app and rotate, right half of my app goes missing!!! 

 

Are these issues related to Simulator or coding in my App?

 

Please help me resolving other issues as well.

 

Thanks

Abhinav Tyagi


There is indeed a bug that does not correctly orient an application that can only be done in one mode (landscape or portrait). As long as your app does not rotate while its the active application and maximized, you should be good to go.

 

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Developer
abhi007tyagi
Posts: 225
Registered: ‎09-29-2010
My Device: Limited Edition Z10, Playbook

Re: Few Issues with application/simulator

Thanks JRAB

 

but I don't have any clue of layout !!!

can you explain with some coding??

 

here is part of my code for dropdown and button

 

            dd = new DropDown();
            dd.rowHeight = 23;
            dd.width = 320;
            dd.dataProvider = new DataProvider(ar);
            dd.addEventListener(Event.SELECT, dropDownData);
                     
            mySub.addChild(dd);
            mySubLeft.addChild(mySub);
            
            //----------Button------------------------------------------------------------------------------------//    
                    
            calculateButton = new LabelButton();
            calculateButton.label = "Calculate";
            calculateButton.sizeUnit = SizeUnit.PERCENT;
            calculateButton.sizeMode = SizeMode.BOTH;
            calculateButton.addEventListener(MouseEvent.CLICK, calculate);
         
            mySubLeft.addChild(calculateButton);

 

Note: dd & button are in diff containers

 

Thanks

Abhinav Tyagi

Blackberry Z10-Limited Edition
Blackberry Playbook (won in free playbook offer)
My Apps : pAinT, HealthMeter, Shoot
Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Few Issues with application/simulator

hey abhi,

 

try doing this after at the end of your program:

 

 

mySubLeft.swapChildren(mySub, calculateButton);

 

This should lay the dropdown container on top of the button without altering the way the container looks. just remember to swap the children again before doing any .layout() methods on the containers. good luck!

 

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Developer
abhi007tyagi
Posts: 225
Registered: ‎09-29-2010
My Device: Limited Edition Z10, Playbook

Re: Few Issues with application/simulator

Thanks JRAB,

 

But this only swapped the dropdown menu and button

It is of no use :smileysad:

 

Thanks

Abhinav Tyagi

Blackberry Z10-Limited Edition
Blackberry Playbook (won in free playbook offer)
My Apps : pAinT, HealthMeter, Shoot
Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Few Issues with application/simulator

not sure if you are implementing it correctly. this is what i had in mind about the swapChildren method:

 

ContainerTest.as:

 

 

package
{
import flash.display.Shape;
import flash.display.Sprite;
import flash.text.TextFieldAutoSize;

import qnx.ui.buttons.LabelButton;
import qnx.ui.core.Container;
import qnx.ui.core.ContainerAlign;
import qnx.ui.core.ContainerFlow;
import qnx.ui.core.SizeUnit;
import qnx.ui.core.Spacer;
import qnx.ui.data.DataProvider;
import qnx.ui.listClasses.DropDown;
import qnx.ui.listClasses.List;
import qnx.ui.listClasses.ListSelectionMode;
import qnx.ui.listClasses.ScrollDirection;
import qnx.ui.listClasses.ScrollPane;
import qnx.ui.text.Label;


[SWF(width="1024", height="600", backgroundColor="#CCCCCC", frameRate="30")]
public class ContainerTest extends Sprite
{
private var mainContainer:Container;

private var topContainer:Container;
private var bottomContainer:Container;

private var containerMargin:int = 10;

private var myList:DropDown;
private var myDataProvider:DataProvider;
private var myArray:Array;

private var btn:LabelButton;

public function ContainerTest()
{
super();

mainContainer = new Container();
mainContainer.margins = Vector.<Number>([containerMargin,containerMargin,containerMargin,containerMargin]);
mainContainer.flow = ContainerFlow.VERTICAL;
mainContainer.align = ContainerAlign.NEAR;

mainContainer.setSize(1024, 600);


topContainer = new Container();

topContainer.margins = Vector.<Number>([containerMargin,containerMargin,containerMargin,containerMargin]);
topContainer.debugColor = 0xFF0000;
topContainer.size = 50;
topContainer.sizeUnit = SizeUnit.PERCENT;

mainContainer.addChild(topContainer);


bottomContainer = new Container();

bottomContainer.margins = Vector.<Number>([containerMargin,containerMargin,containerMargin,containerMargin]);
bottomContainer.debugColor = 0xFFFF00;
bottomContainer.size = 50;
bottomContainer.sizeUnit = SizeUnit.PERCENT;

mainContainer.addChild(bottomContainer);



myList = new DropDown();
myArray = new Array();

myArray.push({label: "Thomas Luddington"});
myArray.push({label: "Master Maruyn"});
myArray.push({label: "Master Gardyner"});
myArray.push({label: "Captain Vaughan"});
myArray.push({label: "Master Kendall"});
myArray.push({label: "Master Prideox"});
myArray.push({label: "Robert Holecroft"});
myArray.push({label: "Rise Courtenay"});
myArray.push({label: "Master Hugh Rogers"});
myArray.push({label: "Thomas Foxe"});
myArray.push({label: "Edward Nugen"});
myArray.push({label: "Darby Glande"});
myArray.push({label: "Edward Kelle"});
myArray.push({label: "Iohn Gostigo"});
myArray.push({label: "Erasmus Clefs"});
myArray.push({label: "Edward Ketcheman"});
myArray.push({label: "Iohn Linsey"});
myArray.push({label: "Thomas Rottenbury"});
myArray.push({label: "Roger Deane"});
myArray.push({label: "Iohn Harris"});

myDataProvider = new DataProvider(myArray);

myList.dataProvider = myDataProvider;

myList.setPosition(100,25);
myList.width = 300;

topContainer.addChild(new Spacer());
topContainer.addChild(myList);

btn = new LabelButton();

btn.label = "Test Button";
btn.setSize(150,52);

bottomContainer.addChild(btn);



mainContainer.layout();

addChild(mainContainer);

/**
* This should do the trick for you here.
*/

mainContainer.swapChildren(topContainer,bottomContainer);
}
}
}

 

Comment and uncomment that line to see the difference. hope that can shed some light on the issue. good luck!

 

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.