08-03-2010 05:23 AM - edited 08-03-2010 05:45 AM
I am developing a screen in which I have to prepare both header and status with controls like Buttons and EditFields. Please have a look at this code
editField = new EditField();
updateButton = new ButtonField("Update");
cancelButton = new ButtonField("Cancel");
* set up Status manager
VerticalFieldManager statusVerManager = new VerticalFieldManager();
HorizontalFieldManager statusManager = new HorizontalFieldManager();
* Add fields in status manager
* Set status as status manager
Here I can see my edit field in status but can not see any of the Update and Cancle Buttons.
Previously I have tried it with subLayout() for both the manager but could not show buttons.
Waiting for your comments on my code. Atleast Help me to figure out what is going wrong.
Thanks in advance folks.
Solved! Go to Solution.
08-03-2010 05:37 AM
The code sems to be incomplete.
Tell the pseudocode.
You haven;t added any field nor the editfield nor the buttons.
08-03-2010 05:54 AM
Instead of writing this setStatus(statusVerManager);
You need to add the statusVerManager.
08-03-2010 06:19 AM
I know it will work.
Ok here is the requirement.
It is the twitter client in which the Header should and footer(Status) should be static. It must always be there in screen and scrolling should not move its position. And I know setTitle and setStatus methods can easily achieve this task. That's why i use setStatus() method instead of add().
08-03-2010 07:32 AM
Solved the problem my self.
Here is the summary what I have done.
1. removedStatusVerManager. Actually it was used only to put a separator above the status horizontal manager.
2. Called sublayout inside the statusManager and bounded its height and width.
3. Called setLayOutChild() to make my edit fiedl fixed width and height.
(I had followed procedure upto 3 before what i had done new is from step 4)
4. Called setPositionChild() method. Actually when i lay out a child I must set its position and position of all the child that is going to be added in same manager. So also set the position of other SIBLING controls with it.
5. Added the controls in manager.
passed it in setStatus. And I am able to render the desired screen.
Thanks @ekansh for your replys.
08-03-2010 07:47 AM
Cheers!!! you got the problem solved.
08-03-2010 12:40 PM
Hate to post in the solved threads, but you went way overboard while solving your issue (even though it does work).
The main problem in your code is your EditField without parameters. It has DEFAULT_MAXCHARS as the number of characters, which is ... a million! That's right - the default of million characters. No wonder it pushes the buttons off the screen!
In order to limit the dimensions of your EditField, pass it a limited number of characters and/or override its layout method to set the extent you wish. The rest will be done by the default BlackBerry managers (this time, your HorizontalFieldManager) automatically.