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
Developer
Posts: 142
Registered: ‎06-26-2009
My Device: Not Specified
Accepted Solution

Popup screen scrolling issue in manager

[ Edited ]

Hi,

 

This could be a simple one but don't knw am stuck. i am trying to implementing a popup screen(basically for EULA screen) which has one Manager(Vertical), one RichTextField and one Button. I want the eula text to be displayed in the manager and only manager should have the scrolling not popup screen and button to be added after manager. 

 

problem: If text in RichTextField is small, then i can see the text and button. But if Text is very long the manager scrolls little bit and not able to see the button at all. 

 

here is wht m done:

 

class ApplicationEulaScreen extends PopupScreen implements FieldChangeListener
{
    private VerticalFieldManager mainContainer;
    private RichTextField eulaText;
    private ButtonField okButton;
    
    ApplicationEulaScreen()
    {
        super(new VerticalFieldManager(VerticalFieldManager.NO_VERTICAL_SCROLL)
        
        mainContainer = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL | VERTICAL_SCROLLBAR | USE_ALL_HEIGHT);
        
        eulaText = new RichTextField("Indicates whether network connectivity is possible. "
        +"A network is unavailable when a persistent or semi-persistent condition prevents the possibility of connecting to that network. Examples include "
        +"* The device is out of the coverage area for any network of this type. "
        +"* The device is on a network other than the home network (i.e., roaming), and data roaming has been disabled. "
        +"* The device's radio is turned off, e.g., because airplane mode is enabled. ", RichTextField.READONLY | RichTextField.USE_TEXT_WIDTH);
        
        okButton = new ButtonField("Ok", ButtonField.FIELD_HCENTER | FOCUSABLE | ButtonField.CONSUME_CLICK);
        okButton.setChangeListener(this);
        
        mainContainer.add(eulaText);
        add(mainContainer);
add(okButton);

        
    }
}

 

need help on this.

 

mainContainer
Highlighted
Trusted Contributor
Posts: 242
Registered: ‎03-16-2010
My Device: 9530

Re: Popup screen scrolling issue in manager

 

Hi,

 

    if the text in RichTextField is more than availalbe space, the button and the extra text will get disturbed.

 

   Instead, I suggest you add RichTextField in another Vertical manager and add vertical scroll bars to it. Add the setExtent in the sublayout of this Vertical manager.  Add this newly created vertical manager in your original manager.

 

    With this the area taken wll be same, plus long text will be visible easily using scrollbars and button will also be in its palce. Your components will stay at their respective places only.

 

   Try out, if it works.

 


--------------------------------------------------------------------------------
For any helpful answers give kudo's (star) to the helper.
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Popup screen scrolling issue in manager

Not tested, but try these changes:

 

From:

        super(new VerticalFieldManager(VerticalFieldManager.NO_VERTICAL_SCROLL)
        
        mainContainer = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL | VERTICAL_SCROLLBAR | USE_ALL_HEIGHT);

 

To:

        super(new VerticalFieldManager(VerticalFieldManager.NO_VERTICAL_SCROLL | USE_ALL_HEIGHT)
        
        mainContainer = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL | VERTICAL_SCROLLBAR);

 

 

Developer
Posts: 142
Registered: ‎06-26-2009
My Device: Not Specified

Re: Popup screen scrolling issue in manager

Thanks trupti and peter for ur reply's.

 

@trupi

The same thing m doing mainContainer is verticalfieldmanger with scroll enabled and m adding richtextfied to it. Only m not overriden its sublayout method with setExtend. Now I have added sublayout method to that manager and it got worked thanks a lot Smiley Happy

 

@peter

I have tried as u suggested but it didn't worked as it has to be, it is giving the same scroll issue. Anyway the trupi's suggestion got worked. Thnks perter for ur suggetions.