BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-08-2008, 10:17 AM   #1 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default Multilevel Lists in native black-berry java

Please Login to Remove!

Sir,
I am having problem in creating a multilevel list, where when I click on an item of first list another list opens, then on clicking on any item on second list third opens and I could navigate backwards through the same path (back button).
---------
I have used Main-Screen for the first menu with Bitmap Icons (List-Field). I can easily navigate back and forth to a second screen with Check-box-Field.
problem occurs when I want to display the screen with no Bitmaps (List-Field).
---------
Though the list does not display properly (Full-Screen), , but the items are accessible using the keys
--------
ScrProfile (Screen) uses LstPlainField (ListField)(attachments) to be displayed.
I can't figure out the logical error in my code.
-------
please help
Regards
Attached Files
File Type: txt Copy of LstPlainField.java.txt (1.4 KB, 21 views)
File Type: txt Copy of ScrProfile.java.txt (1.8 KB, 20 views)
Offline  
Old 07-08-2008, 10:36 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i am not working with listfields anymore as i have created my own objectlistfield with an external callback but my guess would be that you have a problem adding the items to the list.
you add new items only to the vector of your listfield but not to super.
try this:
Code:
public synchronized void insert(int index, Object object) {
	vEl.insertElementAt(object, index);
	super.insert(index);
}
(you should synchronize all public methods of the listfield. there are possible index issues if the screen invalidates while there is a delete or add call running)
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 07-09-2008, 01:07 AM   #3 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Unhappy Mltilevel List

Thanks Sir ,
But have you an answer how is it working in the other List-Field.
Example attached
-------------
also it will be a great help if you get me an example how have you used
ObjectListField, (maybe you have used LabelField I presume).
--------------
My problem is that the listitems have been added, through alert I have been able to get these items displayed. Only the Items are not visible.
in the alert i have also displayed the following:
Dialog.alert(strObj+","+getVisibleWidth()+","+getV isibleWidth());
and it is reporting :"ItemName,0,0"
that means the height and width of the screen, both are 0
---------------
How to set the height and width:
I have used :

setFocus and setExtent for a try but the either one is giving
"modalScreen called by non event thread exception" or something like that
then:
// setPosition(x, y);
// setRowHeight(50);
// layout(0, 0);

then:

//protected synchronized void layout(int width, int height) {
// // Update the cached font in case it has been changed.
//
// // Calculate width.
// width = Math.min(width, getPreferredWidth(this));
//
// // Calculate height.
// height = Math.min(height, getPreferredHeight(this));
//
// // Set dimensions.
// setExtent(width, height);
// }

but to my surprise the code control is not reaching the
drawListRow() implemented function

-------------
Regards
----------
Attached Files
File Type: txt ScrMainMenu.java.txt (3.8 KB, 7 views)
File Type: txt LstField.java.txt (1.7 KB, 5 views)

Last edited by abhsax1978@hotmail.com : 07-09-2008 at 06:58 AM. Reason: Upon new observations
Offline  
Old 07-09-2008, 09:23 AM   #4 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Smile Nothing to worry

Sorry Folks , I don't know how, but now the code is working fine with no changes at all.
Just copied the code that was working overriding the code which wasn't working
. found that the earlier code and the new code in the Screen implementation have no difference,
and lo! all was fine afterwards

Last edited by abhsax1978@hotmail.com : 07-09-2008 at 09:24 AM.
Offline  
Old 07-09-2008, 09:24 AM   #5 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default

Try to use invokeAndWait() using Runtime, when you have to display a new screen.
Use MainScreen with FullScreen Options.

Last edited by abhsax1978@hotmail.com : 07-21-2008 at 02:27 AM.
Offline  
Old 07-09-2008, 09:25 AM   #6 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default

You can use VerticalFieldManagers array for proper alignment of top to down approach and horizontal field manager for side by side display of elements. add elements to these managers then add to a single FieldManager with your chosen Horizontal or vertical.

Add the last manager to the screen.

Last edited by abhsax1978@hotmail.com : 07-21-2008 at 02:31 AM.
Offline  
Old 07-09-2008, 09:25 AM   #7 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default

fine
Offline  
Old 07-09-2008, 09:25 AM   #8 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default

done it
Offline  
Old 07-09-2008, 09:26 AM   #9 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default

all right
Offline  
Old 07-21-2008, 02:36 AM   #10 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default

You can use two ObjectListFields, one for displaying Bitmap, another to display the String. By using the following layout you can create custom ListField displaying images for each item.

Quote:
Originally Posted by abhsax1978@hotmail.com View Post
You can use VerticalFieldManagers array for proper alignment of top to down approach and horizontal field manager for side by side display of elements. add elements to these managers then add to a single FieldManager with your chosen Horizontal or vertical.

Add the last manager to the screen.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.