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
New Contributor
Hmwe
Posts: 6
Registered: ‎11-23-2010
My Device: Not Specified
Accepted Solution

scrollpane does not work scorlling

I got problem that scrollpane in qnx component does not work for scroll content.

i want to put the scrollpane to flex component Canvas. the contents are display but can't scroll.

here is my code.

 

 

 var s:smileyfrustrated:prite=new Sprite();
  var pane:smileyfrustrated:crollPane=new ScrollPane();
 var lbl:Label=new Label();
 lbl.width=100;
 lbl.height=200;
 lbl.multiline = true;

lbl.wordWrap=true;            
 lbl.text="File Viewer The List class does not have a sense of columns like" +
                     " a DataGrid component might. What you can do to get your desired result is create " +
                     "a custom CellRenderer and use that in your list. This will give you the ability to " +
                     "layout your columns based on specific data." +
                     "File Viewer The List class does not have a sense of columns like" +
                     " a DataGrid component might. What you can do to get your desired result is create " +
                     "a custom CellRenderer and use that in your list. This will give you the ability to " +
                     "layout your columns based on specific data."+
                     "File Viewer The List class does not have a sense of columns like" +
                     " a DataGrid component might. What you can do to get your desired result is create " +
                     "a custom CellRenderer and use that in your list. This will give you the ability to " +
                     "layout your columns based on specific data.";
                
            var container:Container=new Container();
            container.addChild(lbl);
            pane.addScrollContent(container);
                //pane.addChild(lbl);
                
                
                 pane.scrollDirection=ScrollDirection.VERTICAL;            
                 pane.scrollY=0;
                 pane.width=1024;
                 pane.height=500;
                 pane.useHandCursor=true;
                 pane.update();                
                // s.addChild(pane);
                
                var c:mx.core.UIComponent=new mx.core.UIComponent();
                
                c.addChild(pane);
                
                mygroup.addElement(c);

 

<mx:Canvas id="mygroup" width="100%" x="0"/>

 

mygroup is canvas in flex 3.

 

anybody  guide me the solution? the problem is not scrolling.

 

Thanks in advance!

Please use plain text.
Developer
kmitchell
Posts: 41
Registered: ‎11-01-2010
My Device: BlackBerry Bold 9780, PlayBook 16GB, PlayBook 32GB

Re: scrollpane does not work scorlling


Hmwe wrote:

I got problem that scrollpane in qnx component does not work for scroll content.

i want to put the scrollpane to flex component Canvas. the contents are display but can't scroll.

here is my code.

                
            var container:Container=new Container();
            container.addChild(lbl);
            pane.addScrollContent(container);
                //pane.addChild(lbl);
     


 

I didnt study your code in much detail, but I have no issues in getting the scroller to work. Just make sure your content size is larger than the scoller. I noticed that you added "Container" to the scoller, but your container has no size dimensions.

 

Please use plain text.
New Contributor
sreejith
Posts: 4
Registered: ‎11-02-2010
My Device: blackberry playbook

Re: scrollpane does not work scorlling

hi,

 

   plz try like this.....

 

var s1:Array=new Array();
                        xml=new XML(e.target.data);
                        var i1:int;
                        
                        var menu:XML=new XML(e.currentTarget.data);
                        for each (menu in xml.ROWDATA.LN.(@fld_lid=="4"))
                        //for(i1=1;i1<=20;i1++)
                        {
                            s1.push(xml.ROWDATA.LN.(@fld_lid=="4"))
                            
                            //i1++;
                        }
                        var j1:int=0;
                        var yy1:int=50;
                        var d1:TextField=new TextField();
                        d1.text="LINE 54";
                        d1.x=400;
                        d1.y=0;
                        d1.selectable=true;
                        d1.textColor=0xFF0000;
                        addChild(d1);
                        var d2:TextField;
                        //d2.scrollV=1;
                        var d21:smileyfrustrated:prite;
                        
                        for each(var x11 in s1)
                        {
                            d2=new TextField();
                            d21=new Sprite();
                            d2.text=s1[j1];
                            d2.x=400
                            d2.y=30;
                            //d2.y=yy1;
                            d2.textColor=0x000000;
                            //d2.scrollV=100;
                            //yy1=yy1+20;
                            d2.height=d2.textHeight;
                            d2.width=400;
                            d21.name=x11;
                            d21.mouseChildren=false;
                            d21.buttonMode=true;
                            
                            
                            var sp:smileyfrustrated:crollPane=new ScrollPane();
                            sp.visible=true;
                            sp.borderColor=0x996600;//0xFF0000;
                            sp.x=375;
                            sp.y=30;
                            sp.setSize(175,300);
                            sp.addScrollContent(d2);
                            addChild(sp);

                            
                            //addChild(d2);
                            
                            //addChild(d21);
                            
                            j1++;
                            
                            
                        }

Please use plain text.
Developer
bradcarvey
Posts: 17
Registered: ‎11-22-2010
My Device: PlayBook

Re: scrollpane does not work scorlling

You label is smaller then your ScrollPane.  If the ScrollPane contents are larger then the ScrollPane, the contents will scroll.  No scrollbars will be visible.  Your finger (mouse in the simulator) is used to move the ScrollPane contents around inside of the ScrollPane.

 

I created a test, base on your code that works.  Note that the Label has lots of text and it's dimensions are larger then the ScrollPane.

 

package

{

import flash.display.Sprite;

 

import qnx.ui.buttons.Button;

import qnx.ui.listClasses.ScrollPane;

import qnx.ui.text.Label;

 

[SWF(width="1024", height="600", backgroundColor="#cccccc", frameRate="30")]

 /**

* <p><b>TestScrollPane</b> class extends Sprite class</p>

* Class declaration.Ê The class is the main class in an actionscript

* only application.

* <p><b>Date:</b>    11/26/2010</p>

* @author Brad Carvey

*/

public class TestScrollPane extends Sprite

{

 /**

* Varible Declarations

*/

public var scroller:smileyfrustrated:crollPane;

public var label:Label;

 

 /**

* <b>TestScrollPane</b> public method

* <p>Constructor method for Class.Ê Call init method toÊ

* initialize the application, then make the application's native 

* window visible.</p>

*/

public function TestScrollPane()

{

init();

stage.nativeWindow.visible = true;

}

 

 /**

* <b>init</b> private method

* <p>Initialize the application.</p>

*/

private function init():void

{

scroller = new ScrollPane();

scroller.width = 400; 

scroller.height = 200; 

scroller.y = 20; 

scroller.x = 20;

this.addChild(scroller); 

 

label = new Label(); 

label.multiline = true

label.width = 600; 

label.height = 300; 

label.text = 

 "File Viewer The List class does not have a sense of columns like" +

"\na DataGrid component might. What you can do to get your desired result is create " +

 "\na custom CellRenderer and use that in your list. This will give you the ability to " +

 "\nlayout your columns based on specific data." +

 "\nFile Viewer The List class does not have a sense of columns like" +

"\na DataGrid component might. What you can do to get your desired result is create " +

"\na custom CellRenderer and use that in your list. This will give you the ability to " +

 "\nlayout your columns based on specific data."+

 "\nFile Viewer The List class does not have a sense of columns like" +

 "\na DataGrid component might. What you can do to get your desired result is create " +

 "\na custom CellRenderer and use that in your list. This will give you the ability to " +

 "\nlayout your columns based on specific data.";

 

scroller.addScrollContent(label);

}

}

}

Please use plain text.
New Contributor
Hmwe
Posts: 6
Registered: ‎11-23-2010
My Device: Not Specified

Re: scrollpane does not work scorlling

thz for reply.

 

i set the container width and height same  as label width and height.

but doesn't work out.

Please use plain text.
New Contributor
Hmwe
Posts: 6
Registered: ‎11-23-2010
My Device: Not Specified

Re: scrollpane does not work scorlling

thanks for reply.

tested already. ok cool.

instead of Label, add TextFiled to scrollpane.

it work out too but can't set text format.

Please use plain text.