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

Java Development

Reply
Contributor
tan_mel_viso
Posts: 10
Registered: ‎06-05-2012
My Device: 9900

Using Rich List need to add Scroll to my BB Screen

Development Env- Eclipse SDK
Version: 3.6.2

 

My Code

public class MyApp extends UiApplication
{
    /**
     * Entry point for application
     * @param args Command line arguments (not used)
     */
    public static void main(String[] args)
    {
        // Create a new instance of the application and make the currently
        // running thread the application's event dispatch thread.
        MyApp theApp = new MyApp();       
        theApp.enterEventDispatcher();
    }
    

    /**
     * Creates a new MyApp object
     */
    public MyApp()
    {        
        // Push a screen onto the UI stack for rendering.
        pushScreen(new Register());
    }    
}

 

 

package mypackage;

import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
import net.rim.device.api.ui.component.table.*;

public final  class Register extends MainScreen{

    public Register()
    {
        super(net.rim.device.api.ui.Manager.NO_VERTICAL_SCROLL);
         StandardTitleBar myTitleBar = new StandardTitleBar()
         .addTitle("Title Bar Demo")
         .addClock()
         .addNotifications()
         .addSignalIndicator();
        
         myTitleBar.setPropertyValue(StandardTitleBar.PROPERTY_BATTERY_VISIBILITY,
                    StandardTitleBar.BATTERY_VISIBLE_LOW_OR_CHARGING);
            setTitleBar(myTitleBar);
            
            BasicEditField enterName = new BasicEditField("LoginID: ", "");
            BasicEditField enterUserName = new BasicEditField("UserName: ", "");
            PasswordEditField enterPIN = new PasswordEditField(
                    "Password: ", "", 4, PasswordEditField.FILTER_DEFAULT);
            BasicEditField enterAddress = new BasicEditField("Address: ", "");
            BasicEditField enterPhone = new BasicEditField(
                    "mobile number: ", "", 10, BasicEditField.FILTER_PHONE);
            String choices[] =
               {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
            int iSetTo = 2;
            add(new ObjectChoiceField("Day of the week",choices,iSetTo));
            add(enterName);
            add(enterUserName);
            add(new SeparatorField());
            add(enterPIN);
            add(enterAddress);
            add(enterPhone);
            add(new LabelField());
            add(new LabelField("BlackBerry Devices", LabelField.FIELD_HCENTER));
            add(new SeparatorField());
            net.rim.device.api.ui.Manager mainManager = getMainManager();
            SimpleList listField = new SimpleList(mainManager);            
            listField.add("Item 1");
            listField.add("Item 2");
            listField.add("Item 3");
            
            mainManager = getMainManager();
            
            RichList list = new RichList(mainManager, true, 2, 1);
    
            Bitmap bitmap1 = Bitmap.getBitmapResource("9500.png");
            Bitmap bitmap2 = Bitmap.getBitmapResource("9000.png");
                
            list.add(new Object[] {bitmap1, "Device 1",
                                   "BlackBerry Smartphone 9500",
                                   "Description of Device 1."});
            list.add(new Object[] {bitmap2, "Device 2",
                                   "BlackBerry Smartphome 9000",
                                   "Description of Device 2."});
            
            
    }
}

 

 

 

basically i want to scroll whole screen vertically

thanx

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Using Rich List need to add Scroll to my BB Screen

why do you use NO_VERTICAL_SCROLL when you want to scroll?
if there is a specific reason you could add a new verticalfieldmanager with VERTICAL_SCROLL.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
tan_mel_viso
Posts: 10
Registered: ‎06-05-2012
My Device: 9900

Re: Using Rich List need to add Scroll to my BB Screen

because if i dont use this line it gives me exception

because i m using RichList along with showing bitmap

as per e.g here

https://developer.blackberry.com/java/documentation/ww_java_uinavigation/list_rich_1984824_11.html

 

Getting Error after commenting ths line

        //super(net.rim.device.api.ui.Manager.NO_VERTICAL_SCROLL);

 

  but now i want scrolling on my screen is there any alternative

 

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Using Rich List need to add Scroll to my BB Screen

ok, i am not familiar with these classes as my projects usually have a 5.0 baseline.
you could use a listfield, you can use the search field to find some samples.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
tan_mel_viso
Posts: 10
Registered: ‎06-05-2012
My Device: 9900

Re: Using Rich List need to add Scroll to my BB Screen

k, i am not familiar with these classes as my projects usually have a 5.0 baseline.

 okie i really didn't got it what u are mentioning over here

what is my baseline of project

and can someone else help me around with this issue.

thanx

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Using Rich List need to add Scroll to my BB Screen

check http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/component/table/RichList.ht...
it says: "Since 6.0"
this means it is only available on devices with OS 6 or higher.
My projects are usually OS 5 and higher, so I don't use RichList.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
tan_mel_viso
Posts: 10
Registered: ‎06-05-2012
My Device: 9900

Re: Using Rich List need to add Scroll to my BB Screen

so in order to work it in OS 6.0 + .OS 7.1 how i can resolve this issue.

or the only solution is to degrade my OS ??

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Using Rich List need to add Scroll to my BB Screen

no, a listfield works fine in all OS versions.

if you cannot put a richlist in a scrollable manager (as the error message suggests) you cannot.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter