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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Contributor
amitginterface
Posts: 36
Registered: ‎09-28-2011
My Carrier: docomo

Event handling on Manager in BlackBerry

 

I had added one VerticalFieldManager on a Screen. I want to handle event on that manager in such a way that it should set particular variable value with respect to that manager preferred height. Following is my code snippet, please check it.

VerticalFieldManager leftVfm =newVerticalFieldManager(Manager.VERTICAL_SCROLL){

   
protectedvoid sublayout(int width,int height){
       
super.sublayout(screenWidth -150, INFO_HEADER_HEIGHT);
        setExtent
(screenWidth -150, INFO_HEADER_HEIGHT);
   
}

   
protectedboolean touchEvent(TouchEvent message){
       
int eventCode = message.getEvent();
       
if(eventCode ==TouchEvent.DOWN){
           
// leftheight should be leftVfm.getPreferredHeight();
            INFO_HEADER_HEIGHT
= leftheight;
       
}
       
returntrue;
   
}
};
Please use plain text.
Developer
simon_hain
Posts: 13,794
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Event handling on Manager in BlackBerry

calling http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/Field.html#updateLayout() should trigger a new layout
----------------------------------------------------------
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
Please use plain text.
Contributor
amitginterface
Posts: 36
Registered: ‎09-28-2011
My Carrier: docomo

Re: Event handling on Manager in BlackBerry

I am asking u another question ur answer is not related to my question

Please use plain text.
Contributor
amitginterface
Posts: 36
Registered: ‎09-28-2011
My Carrier: docomo

Re: Event handling on Manager in BlackBerry

Any help will be accepted.I am still stuck to that issue

Please use plain text.
Developer
peter_strange
Posts: 17,689
Registered: ‎07-14-2008

Re: Event handling on Manager in BlackBerry

I am not clear on what you want to do and why.  It would appear from your code that you want to change the height of the Manager when it is touched, which to me seems a little odd.  If you explain what we are trying to achieve we can perhaps suggest how it should be done (e.g. using a Field and not a Manager), rather than doing something artificial.  So can you explain?  Thanks.

Please use plain text.
Contributor
amitginterface
Posts: 36
Registered: ‎09-28-2011
My Carrier: docomo

Re: Event handling on Manager in BlackBerry

[ Edited ]

you understand my question exactly right way.I had added one Vertical manager on my screen and I want to increase height of that manager when user taps any where on that manager.my main purpose is that  I want to allot particular area to that vertical field manager when i am adding it on a screen but all the data whichever I had added in that manager cant be viewable at a time(data is big & height of manager is less) to  so make it viewable I want to handle touch screen event so that when user taps on that manager the height of manager should increase so that all the content should be viewable

Please use plain text.
Developer
simon_hain
Posts: 13,794
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Event handling on Manager in BlackBerry

and you are aware of the fact that a manager is a layout element and not visible on the screen per se?
(unless changed by background, border or similar)
----------------------------------------------------------
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
Please use plain text.
Developer
peter_strange
Posts: 17,689
Registered: ‎07-14-2008

Re: Event handling on Manager in BlackBerry

Simon's point is valid.  I understand your wish to expand or contract the screen space used by the Manager, and I don't think that is too difficult, but I think that you would be better having some viisble indication, like a button, or perhaps a menu, that the user can easily use to control this. 

Please use plain text.
Contributor
amitginterface
Posts: 36
Registered: ‎09-28-2011
My Carrier: docomo

Re: Event handling on Manager in BlackBerry

Actually the users for which i am developing this application are having requirement that they dont want the button or menu option.they only want to expand that manager by clicking anywhere on it.

Please use plain text.
Developer
simon_hain
Posts: 13,794
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Event handling on Manager in BlackBerry

did you try what i suggested in my first post?
when you update the value used in layout and trigger a re-layout it should change its size.
----------------------------------------------------------
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
Please use plain text.