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
Developer
mantaker
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
Please use plain text.
New Developer
l33tsauce
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
Please use plain text.
New Developer
l33tsauce
Posts: 37
Registered: ‎03-31-2009
My Device: Not Specified

Re: Can a set of CheckboxFields nested?

Please use plain text.
Developer
peter_strange
Posts: 19,601
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.

Please use plain text.
New Developer
l33tsauce
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); } } } }

 

 

 

Please use plain text.
Developer
mantaker
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
Please use plain text.
Developer
mantaker
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
Please use plain text.