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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810
Accepted Solution

Can a set of CheckboxFields nested?

My dear experts..

 

Is there a way to nest a set of checkboxes in a screen? I tried putting checkbox inside a tree but no use.. I however think this can't be achieved..

 

Thanks.. 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
New Developer
Posts: 37
Registered: ‎03-31-2009
My Device: Not Specified

Re: Can a set of CheckboxFields nested?

[ Edited ]

there has to be a way!

 

look at this if you have a storm

 

Options -> Advanced Options -> Applications Then Menu Button -> Edit Permissions

 

That screen shows ObjectChoiceFields in a TreeField, right?

Message Edited by l33tsauce on 04-02-2009 07:22 AM
New Developer
Posts: 37
Registered: ‎03-31-2009
My Device: Not Specified

Re: Can a set of CheckboxFields nested?

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Can a set of CheckboxFields nested?

Can you explain again what you want?  Do you want a Tree like Field or something simpler?

 

For example, you could add indented check boxes to the Screen - that would look like nesting.

Highlighted
New Developer
Posts: 37
Registered: ‎03-31-2009
My Device: Not Specified

Re: Can a set of CheckboxFields nested?

Something like this, except in this situation, the checkbox field shows up as an empty clickable field:

 

 

/* * Test.java * * © <your company here>, 2003-2008 * Confidential and proprietary. */ package Test; import net.rim.device.api.ui.Graphics; import net.rim.device.api.ui.UiApplication; import net.rim.device.api.ui.component.TreeField; import net.rim.device.api.ui.component.TreeFieldCallback; import net.rim.device.api.ui.component.CheckboxField; import net.rim.device.api.ui.container.MainScreen; public class Test extends UiApplication { TreeCallback _myCallback; TreeField _myTree; public static void main(String[] args) { Test app = new Test(); app.enterEventDispatcher(); } public Test() { String fieldOne = "Main Folder2"; String fieldTwo = "Main Folder1"; String fieldThree = "SubFolder3"; CheckboxField fieldFour = new CheckboxField("Task 1", true); String fieldFive= "Task 2"; _myCallback = new TreeCallback(); _myTree = new TreeField(_myCallback, TreeField.FOCUSABLE); int node1 = _myTree.addChildNode(0, fieldOne); int node2 = _myTree.addChildNode(0, fieldTwo); int node3 = _myTree.addChildNode(node2, fieldThree); int node4 = _myTree.addChildNode(node3, fieldFour); int node5 = _myTree.addChildNode(node3, fieldFive); MainScreen mainScreen = new MainScreen(); mainScreen.add(_myTree); pushScreen(mainScreen); } public static class TreeCallback implements TreeFieldCallback { public void drawTreeItem (TreeField tree, Graphics g, int node, int y, int width, int indent) { Object obj = tree.getCookie(node); if (obj instanceof String) { String text = (String)obj; g.drawText(text, indent, y); } } } }

 

 

 

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Can a set of CheckboxFields nested?

Peter, I don't have a need to do that anyway! One of our members need this, which is conversated in the thread below..

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=28085

 

Well, lemme try to explain you .. I need a tree like structure that should bear the functionality of an user can check it ..

 

Thanks! 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Can a set of CheckboxFields nested?

Seems it can't be ..

 

Thanks. 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group