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
sowjanya1919
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company
Accepted Solution

panemanagerview scroll problem

i implemented the panemanager where scroll is happening only form pane tiltle area.Means in touch screen when i am swiping in the pane title area then only scroll is happening.

But i want when i swip in content area too the panel has to change from left to right and right to left.

Can anyone tell me how to achive this

Please use plain text.
Developer
peter_strange
Posts: 19,602
Registered: ‎07-14-2008
My Device: Not Specified

Re: panemanagerview scroll problem

Can you please post sample code that we can try?

Please use plain text.
Developer
sowjanya1919
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

Re: panemanagerview scroll problem

for defining the pane manager

==============================

public class BasicPaneManagerView extends PaneManagerView{
    private TitleView _header;
    private PaneManagerModel _model;
    private int _currentlySelectedIndex = 0;
    private boolean _curSelectedBeenSet = false;
 
    /**
     * Pane View Constructor
     * @param enableLooping Do the panes loop. (i.e. In UI with 3 panes, can you swipe left from 1-3)
     * @param style Field Styles. (Good idea to pass in Field.FOCUSABLE for example)
     * @param title The header style. The container that will house the pane titles.
     */
    public BasicPaneManagerView(boolean enableLooping, long style, TitleView title){
        super(style, title, new PaneView(0));
        _header = title;;
 
        _model = new PaneManagerModel();
        _model.enableLooping(enableLooping);
        title.setModel(_model);
        PaneManagerController controller = null;
        controller = new HorizontalScrollableController();
        controller.setModel(_model);
        controller.setView(this);
        _model.setController(controller);
        this.setController(controller);
 
        PaneView paneView = new PaneView(Field.FOCUSABLE);
        paneView.setModel(_model);
        super.setPane(paneView);
 
        this.setModel(_model);
        _model.setView(this);
    }
 
    /**
     * Get TitleView header associated with this Pane Manager
     * @return TitleView header associated with this Pane Manager
     */
    public TitleView getHeader(){
        return _header;
    }
 
    /**
     * Add a pane to the pane collection
     * @param paneToAdd Insert pane into manager
     */
    public void addPane(Pane paneToAdd){
        _model.addPane(paneToAdd);
        if (!_curSelectedBeenSet){
            this.setCurrentlySelectedIndex(_currentlySelectedIndex);
        }
    }
 
    /**
     * Set the start pane. By default it will be set to the first pane added to the collection
     * @param currentlySelected Which pane will appear to user first on paint.
     */
    public void setCurrentlySelectedIndex(int currentlySelected){
        _model.setCurrentlySelectedIndex(currentlySelected);
    }
 
}

 

 

 

 

call or using the above panemanager

==================================

TitleView header1 = new HorizontalScrollableTitleView(Field.FOCUSABLE);
     paneView = new BasicPaneManagerView(false, Field.FOCUSABLE | BasicPaneManagerView.DIRECTION_FORWARDS|BasicPaneManagerView.DIRECTION_BACKWARDS , header1);
    paneView.addPane(createFirstPane());
    paneView.addPane(createSecondPane());
    paneView.addPane(createThirdPane());

    subvert.add(paneView);
   

difining the panes

===============

private Pane createThirdPane(){
        //Manager for content
    VerticalFieldManager vfm = new VerticalFieldManager(Field.USE_ALL_HEIGHT| Manager.NO_VERTICAL_SCROLL | Manager.NO_HORIZONTAL_SCROLL ){
        
    };
    //Add the content
        ButtonField buttonField_1 = new ButtonField( "Content Third pane", ButtonField.CONSUME_CLICK | ButtonField.FIELD_HCENTER );
        vfm.add( buttonField_1 );
        //Create the pane
        CustomLabelField paneTitle=new CustomLabelField("Calander3",Color.WHITE,20,0){
            
               protected void layout(int maxWidth,int maxHeight)
               {
                   super.layout(getPreferredWidth(),getPreferredHeight());
                   setExtent(this.getWidth(),50);
            }  
        };
        Pane pane = new Pane(paneTitle, vfm);
    return pane;
    }

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,602
Registered: ‎07-14-2008
My Device: Not Specified

Re: panemanagerview scroll problem

I see you didn't understand what I meant here:

http://supportforums.blackberry.com/t5/Java-Development/horizontal-scroll-problem-in-touch-screen/m-...

 

By standalone, I meant an example that did not rely on anything external.  So can you create a sample with standard Blackberry supplied Fields and Manager with no overrides.  That way we can easily run the code.  And you can see if the problem is in your alterations.

 

As an example, of where your code might be causing issues, this is, in my opinion, code that has potential to introduce problems.

               protected void layout(int maxWidth,int maxHeight)
               {
                   super.layout(getPreferredWidth(),getPreferredHeight());
                   setExtent(this.getWidth(),50);
            }  

Review my comments about similar code in this Thread:

http://supportforums.blackberry.com/t5/Java-Development/Unusual-java-uncaught-outofmemory-error/m-p/...

 

Anyway, please recreate this using standard components and see if your problem is resolved.  If not, then please post that code. 

Please use plain text.
Developer
sowjanya1919
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

Re: panemanagerview scroll problem

i tried from the following link ...

http://dftr.ca/?p=190

just have a look on it....

Please use plain text.
Developer
peter_strange
Posts: 19,602
Registered: ‎07-14-2008
My Device: Not Specified

Re: panemanagerview scroll problem

Thank you for sharing that link, looks like a useful article.

 

Doesn't change what I asked you to do though.  Other people might, but in this case if I am to review and try your code it should use standard Fields and not override things like layout or sublayout.

 

Have you actually tried that code?  If you have and it shows a problem, how about reporting the problem to the the developer?

Please use plain text.
Developer
sowjanya1919
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

Re: panemanagerview scroll problem

i got it...the only problem in scroll is the touch in simulator...when i test my app in device all is working fine ...

The above code is fine..we can scroll the screen even by touching the paneview and also by swiping on title bar .

Please use plain text.