04-02-2009 06:50 AM
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..
Solved! Go to Solution.
04-02-2009 07:20 AM - edited 04-02-2009 07:22 AM
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?
04-02-2009 07:36 AM
That thread touches on the subject, but there is no conclusion.
04-02-2009 07:41 AM
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.
04-02-2009 07:43 AM
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); } } } }
04-02-2009 07:45 AM
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/mess
Well, lemme try to explain you .. I need a tree like structure that should bear the functionality of an user can check it ..
Thanks!
04-03-2009 06:06 AM
Seems it can't be ..
Thanks.