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
Contributor
anshulmittal_nsit
Posts: 15
Registered: ‎06-11-2010
My Device: NA
My Carrier: NA
Accepted Solution

how to make listfield rows selectable ,when the list has been added to a dialog

hi

 

 

 

I have added a listfield to a dialog.Now i want that when i click on any row of this list field i should get a menu(i.e. something should be available to me so that i can perform some action on the selected row).But when i click on the row nothing happens.

 

Please help

 

Please use plain text.
Developer
simon_hain
Posts: 15,798
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: how to make listfield rows selectable ,when the list has been added to a dialog

welcome to the forums.

 

on a popupscreen (like dialog) there are no menus available (as they are also popupscreens)

----------------------------------------------------------
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
anshulmittal_nsit
Posts: 15
Registered: ‎06-11-2010
My Device: NA
My Carrier: NA

Re: how to make listfield rows selectable ,when the list has been added to a dialog

Then can anyone give me a way to do some action on the items in the listfield added to a dialog box.

 

Please use plain text.
Developer
tiandi79
Posts: 110
Registered: ‎10-22-2009
My Device: 9700
My Carrier: ChinaMobile

Re: how to make listfield rows selectable ,when the list has been added to a dialog

pushscreen a popupscreen when u click the row of listfield. and set the popupscreen's position to the left bottom if u hope it looks like a menu.

Best Regards,
Tiandi
www.tiandiyoyo.com
Please use plain text.
Developer
filiussoft
Posts: 106
Registered: ‎06-18-2009
My Device: Bold

Re: how to make listfield rows selectable ,when the list has been added to a dialog

Create your own screen, make its dimensions less than the actual display to make it look like a popup screen. When a row is selected/clicked, call makeMenu.

----
If this helped you, press the thumbs up button (on the far right - '+' thumb icon)
If this post solved the issue, click "Accept as Solution"
Please use plain text.
Contributor
anshulmittal_nsit
Posts: 15
Registered: ‎06-11-2010
My Device: NA
My Carrier: NA

Re: how to make listfield rows selectable ,when the list has been added to a dialog

 

Thanks for the idea.

I am pushing a mainscreen with a smaller dimesion on top of the present screen with the listfield.But the problem is that it is coming in the left-top corner.I want it in the middle.

 

protected void sublayout(int width, int height) {// TODO Auto-generated method stub

 

 

 Screen field = getScreen();

 layoutChild(field, width, height);

 setPositionChild(field, 50, 50);

 setExtent(200, 200);

 

}

 

i have extended the mainscreen and overridden the sublayout as above where setPositionChild(field, 50, 50); should place the screen at coordinate 50,50 i.e closer to the center.BUt it gives an error that Field is not child of manager. 

 

Kindly help

Please use plain text.
Developer
filiussoft
Posts: 106
Registered: ‎06-18-2009
My Device: Bold

Re: how to make listfield rows selectable ,when the list has been added to a dialog

Use setPosition and not setChildPosition.

 

Try this for your sublayout method:

 

 

	protected void sublayout(int width, int height)
	{
        layoutDelegate(200, 200);
        setPositionDelegate(0, 0);
        
        setPosition(50, 50);
        setExtent(200, 200);
	}

 

I could not recommending hardcoding the position/width/heigh but rather use a percentage of the actual screen width/height to position your "popup" screen.

 

----
If this helped you, press the thumbs up button (on the far right - '+' thumb icon)
If this post solved the issue, click "Accept as Solution"
Please use plain text.
Contributor
anshulmittal_nsit
Posts: 15
Registered: ‎06-11-2010
My Device: NA
My Carrier: NA

Re: how to make listfield rows selectable ,when the list has been added to a dialog

Thank u

Please use plain text.