BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-08-2008, 09:17 AM   #1
abhsax1978@hotmail.com
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
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, 09:36 AM   #2
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
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, 12:07 AM   #3
abhsax1978@hotmail.com
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
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 05:58 AM.. Reason: Upon new observations
Offline  
Old 07-09-2008, 08:23 AM   #4
abhsax1978@hotmail.com
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
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 08:24 AM..
Offline  
Old 07-09-2008, 08:24 AM   #5
abhsax1978@hotmail.com
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
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 01:27 AM..
Offline  
Old 07-09-2008, 08:25 AM   #6
abhsax1978@hotmail.com
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
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 01:31 AM..
Offline  
Old 07-09-2008, 08:25 AM   #7
abhsax1978@hotmail.com
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
Default

fine
Offline  
Old 07-09-2008, 08:25 AM   #8
abhsax1978@hotmail.com
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
Default

done it
Offline  
Old 07-09-2008, 08:26 AM   #9
abhsax1978@hotmail.com
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
Default

all right
Offline  
Old 07-21-2008, 01:36 AM   #10
abhsax1978@hotmail.com
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
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Jelenko Commodore LS VPF with Pump  picture

Jelenko Commodore LS VPF with Pump

$875.00



Windsor Commodore Duo 20

Windsor Commodore Duo 20" Carpet extractor w/Lester Charger 25900/Battery/99hour

$2519.95



Vintage MOS 8502 8502R0 Commodore C64 very rare good condition x 1pc picture

Vintage MOS 8502 8502R0 Commodore C64 very rare good condition x 1pc

$22.00



6500/1 A 6502 VARIENT CPU COMMODORE USE IN AMIGA KB & 1520 PLOTTER NMOS NCR NOS picture

6500/1 A 6502 VARIENT CPU COMMODORE USE IN AMIGA KB & 1520 PLOTTER NMOS NCR NOS

$5.89



Vintage Printer Switch box Commodore 64/Sanyo Mountable Computer PC picture

Vintage Printer Switch box Commodore 64/Sanyo Mountable Computer PC

$49.00



MCR 6003L Commodore PVC/Non-Woven Poly/Nylon RAIN Suit 3 PC YELLOW  SIZE LARGE picture

MCR 6003L Commodore PVC/Non-Woven Poly/Nylon RAIN Suit 3 PC YELLOW SIZE LARGE

$13.99







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