Tree Population in COLLAPSED mode

Hi All,
I have a "hirarchical tree" based on a group ...i am populating the tree using POPULATE TREE procedure but whenever it populates it populates in expanded mode which gives a odd look while populating...so can I populate the tree in COLLAPSED mode?
thanks

Put status = -1
for eg:
This query will show the tree as collapsed
select -1,level,ename,null,empno
from emp
connect by prior empno=mgr
start with mgr is null
--(-1 indicates status)
Following query shows expanded
select 1,level,ename,null,empno
from emp
connect by prior empno=mgr
start with mgr is null
Message was edited by:
        jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Tree view in collapsed mode by default

    Hello Experts,
    Could you please explain how to get a tree view collapsed by default?
    My scenario:
    When looking for a Marketing Segment, the system displays the result with a tree view in expanded mode, containing all the Profile Sets with their profiles and Target Groups.
    I would like to have the tree view in collapsed mode by default with only the Profile Sets displayed. Then, if need I would expand a given Profile Set to display its Profiles and Target Groups.
    Component: SEGAS_SEG
    View: RTSEG
    Thank you very much for your answer.
    Best Regards.
    Edited by: KenshiroHokuto on Apr 26, 2010 5:15 PM
    Edited by: KenshiroHokuto on Apr 26, 2010 5:16 PM

    Hi,
         Have a look at the context node SEG in the view RTSEG. You will see a method REFRESH. The following lines are responsible for the automatic expansion.
            IF search_roundtrip = abap_true AND lv_index < 20.
              lr_root->expand_node( ).
            ENDIF.
      Going by what you say, you will want to comment out these lines. If your component/view is not enhanced, enhance it and redefine this method. Copy the standard code and alter it. You need to alter this code to suit your requirement. For enhancing the component/view, you can find wikis in the CRM WebClient UI section.
    Regards,
    Arun Prakash

  • Tree to be displayed in collapsed mode

    Hi All,
    I have designed a recursive tree UI element which is assigned to respective context element.
    When I display  the tree, the first root node gets expanded to the end leaf node showing the depth of the tree.
    The requirement is that the tree should be displayed in a complete collapsed mode.
    I have set the expanded property to false and the property has children to false.
    Could you please let me know how do I achieve the above functionality?
    Regards,
    Tanveer.

    Hi,
    Sounds like your context node is set to initialize the lead selection, causing your tree to lead select all the way down.  If I'm right, in your case, even after you set the expanded property to false, the tree expands itself because of the lead selection.  If you set the initializeLeadSelection property of your context node to false, you should be able to control the tree via the expanded property on the nodes.  You just need to make sure to lead select the root node.
    By the way, the hasChildren property is not used for determining expanded or collapsed.  It is used for determining whether or not a node is a leaf.
    Hope this helps,
    David

  • Balanced Scorecard overview screen-trees to be displayed in collapse mode

    When the user logs into Balanced Scorecard overview screen all the trees are displayed in expanded mode, need to display the trees in collapse mode by default. i.e Only nodes visible should be top level hierarchy nodes. The user should be able to decide which nodes he wants to expand.

    Hi RP,
    1. 0SEM_C02 can typically be used to store all the initiatives. Please note that initiatives can be linked to Project Systems in SAP R/3 and the project data can be automatically brought over to initiatives. Now it may happen that not all of those initiatives may be dependent on scorecards and there can be scorecard independent initiatives. The business content cube that you mentioned can be used to store and report on such inititives and their links to scorecards if any.
    2. What infoobjects to have in the scorecard cube depends upon your requirements and there is not a good or bad choice here. If you choose 0SEM_POSIT as one of the infoobjects, then you can easily access all the measures.
    3. The data read from BW or buffer also depends upon your performance requirements. If your situation is such that you must report the latest data in BW all the time, then reading from buffer only will not serve your purpose because the data will be read only from the buffer and not from the cube. In that case, you may have to fill the buffer often to keep the buffer data up to date. If you select read from Bw only, then it will bypass your buffer and for every small request, it will access the infocube(s). This may be performace drag depending upon the size of the data, performance of the related queries etc. If you choose read from buffer/BW with latest time stamp, then it will access BW only if latest data resides there. This may not be a good option if the performace is a prime concern. Ofcourse if you are using BIA, then you can safely read from BW.
    Regards
    Pravin

  • Trying to override the default af:tree expanded and collapsed icons

    Hi,
    I initially hijacked a thread from 2010 that was vaguely similar to what I need to ask, but a kind forum moderator split my post out to stand on its own merits.
    I am trying to override the default af:tree expanded and collapsed icons I am using the following styles for my af:tree but they are not reflecting any thing on my tree with the styleclass orgType.
    af|tree.orgType::expanded-icon {
    content: url("../images/ac-expand.png");
    cursor: default;
    af|tree.orgType::collapsed-icon {
    content: url("../images/ac-collapsed.png");
    cursor: default;
    af|tree::expanded-icon {
    content: url("../images/folder_open.png");
    cursor: default;
    af|tree::collapsed-icon {
    content: url("../images/folder_close.png");
    cursor: default;
    After working for long hours I realized that there is some problem with af:tree and treeTable. They are not taking the styles where as for the other components, every thing works fine. Is there any way to achieve the task. Could you suggest any alternative way to do this. Thanks in advance. Your suggestions for this task can really help me and my team a lot.
    Regards,
    Krishna Sumanth.

    Hi,
    do the icons show without the style class reference used in the skin file? If so, then the style class for this component might be rendered differently for the tree, e.g.
    .orgType af|tree ...
    Frank

  • Issue with Hgrid once it is in collapse mode

    I need to iterate Hgrid once it is in collapse and need to perform some validation for each row of Hgrid. OAHGridQueriedRowEnumerator is not working once Hgrid is in collapse mode. If Hgrid is in expanded mode OAHGridQueriedRowEnumerator is working fine.
    Please let me know how to get row handle once Hgrid is in collapse mode. Its urgent.
    Thanks,
    RV

    Have the Activity window open, and click the stop sign there. Of course, you'd better be quick even with it already visible. IMHO, if you do this sort of thing a lot, you need to wait at least 5 minutes before you send every message, to give you a chance to rethink. Don't rely on being able to get your mouse to a button before the message gets sent.

  • Forms Builder-hierarchical tree(expanding and collapsing nodes)

    hi friends,
    can anyone help me with populating my hierarchical tree form by using codes for collapsing and expanding?
    for instance when_button_pressed:
    tree_control.expand_all(tree_control.v_item_name); //this is for expanding all the nodes in the tree structure
    well, i have an sql statement in my record group which in turn defines the structure of the hierarchical tree.
    Is it possible to just use the codes 'tree_control.expand_all(tree_control.v_item_name);' like that in the when-button-pressed trigger?
    Thanks for any help :)

    Hi
    can anyone help me with populating my hierarchical tree form by using codes for collapsing and expanding?
    Pls have a look here ....
    Hope this helps...
    Regards,
    Amatu Allah.

  • Tree control in veiw mode

    I am Populating a tree and in teh veiw mode I want to restrict the selection of any node... Can u please help me to do this rather than setting the Enable Property False

    Hi,
    As per my understanding, your requirement is not allowing the user to select a node. If that is the case. This code could be used in a WHEN-TREE-NODE-EXPANDED/WHEN-TREE-NODE-SELECTED trigger and will make the user unable to select a node.
    DECLARE
    myhtree ITEM;
    BEGIN
    -- Find the tree.
    myhtree := FIND_ITEM('<block>.<tree_item>');
    -- Make the clicked node as unselected.
    FTREE.SET_TREE_SELECTION(myhtree, :SYSTEM.TRIGGER_NODE, FTREE.SELECT_OFF);
    END;

  • Field value is not getting populated in Display mode

    Hello All,
    I have created a custom drop down field in the DEAL component through EEWB. From the GUI, I could able to select a value form the drop down list field and save it.
    In DISPLAY mode,  the value is not showing but when I change the screen to EDIT mode then the value is getting populated.
    Please advise.
    Thanks in advance.

    When debugging the set_property method I see the following code:
    If ME->IS_CHANGEABLE( ) = ABAP_TRUE and                  "CLASS=CL_CRM_BOL_ENTITY
               LV_PROPS_OBJ->GET_PROPERTY_BY_IDX( LV_IDX ) ne IF_GENIL_OBJ_ATTR_PROPERTIES=>READ_ONLY
    *     change value
          <VALUE> = IV_VALUE.
    In display mode none of these conditions are fulfilled, meaning value is not set.
    So, is there a way of avoiding this behavior?

  • Custom Field value is not getting populated in Display mode

    Hi Experts ,
    I have created a custom field on sales tab for BP Role Bill to prty in BP transaction in SAP CRM. The problem i am facing is that , after i chose my sales area field value is not populating in first time no matter whether i am in display or change mode but the moment i switch to the other mode the value is being populated. Kindly help me in solving this.
    Regards,
    Ameet

    Dear Chetan,
    If the field is added through AET, can you please check the Get & Set Methods?
    If the field value has fixed values which you have defined while creating, then check GET_V & GET_P methods.
    Thanks & Kind Regards,
    Ravi Kumar A R

  • How to set the XML tree to be collapsed by default at run time?

    I am developing a simple software in Java, to improve my programming skills, the output of this program is an XML file. I am very new to XML. My question is that, every time the XML file is opened the tree is in expanded form, which appears to be the default setting at run time. I want it to be fully collapsed when the XML file is opened. I have read about certain solutions to this problem by using XSL or CSS. I am not familiar with XSL at the moment so I have not explored it yet. Is there any other way around this problem.
    I would like someone to just point me in the right direction so that I can eventually get to the answer.
    Any help will be highly appreciated.
    Thankyou

    Bscript wrote:
    My question is that, every time the XML file is opened the tree is in expanded form, which appears to be the default setting at run time. I want it to be fully collapsed when the XML file is opened. If you are asking to control the XML display in text editor when the XML is opened, I think you can't control it through the java. How the individual editor shows the XML is their property. For example, if you open the file in notepad, you may not get the pretty XML however if you open if the file in XML editor like XMLSpy, you may get its hierarchical representation.

  • Assign focus on text field associated with tree item in edit mode

    The JavaFX home page has an example for how to edit the label associated with a tree item using a cell factory (see sample code below). However, if you select a tree item and then either mouse click or select the Enter key to start editing, the text field doesn't get focus even though the startEdit() method invokes textField.selectAll(). I tried invoking textField.requestFocus(), but that didn't work. Is there a way to ensure that the text field gets focus when the tree item is in edit mode?
    I'm using JavaFX 2.1 GA version on Windows 7.
    Thanks.
    Stefan
    @Override
    public void startEdit() {
    super.startEdit();
    if (textField == null) {
    createTextField();
    setText(null);
    setGraphic(textField);
    textField.selectAll();
    public class TreeViewSample extends Application {
    private final Node rootIcon =
    new ImageView(new Image(getClass().getResourceAsStream("root.png")));
    private final Image depIcon =
    new Image(getClass().getResourceAsStream("department.png"));
    List<Employee> employees = Arrays.<Employee>asList(
    new Employee("Ethan Williams", "Sales Department"),
    new Employee("Emma Jones", "Sales Department"),
    new Employee("Michael Brown", "Sales Department"),
    new Employee("Anna Black", "Sales Department"),
    new Employee("Rodger York", "Sales Department"),
    new Employee("Susan Collins", "Sales Department"),
    new Employee("Mike Graham", "IT Support"),
    new Employee("Judy Mayer", "IT Support"),
    new Employee("Gregory Smith", "IT Support"),
    new Employee("Jacob Smith", "Accounts Department"),
    new Employee("Isabella Johnson", "Accounts Department"));
    TreeItem<String> rootNode =
    new TreeItem<String>("MyCompany Human Resources", rootIcon);
    public static void main(String[] args) {
    Application.launch(args);
    @Override
    public void start(Stage stage) {
    rootNode.setExpanded(true);
    for (Employee employee : employees) {
    TreeItem<String> empLeaf = new TreeItem<String>(employee.getName());
    boolean found = false;
    for (TreeItem<String> depNode : rootNode.getChildren()) {
    if (depNode.getValue().contentEquals(employee.getDepartment())){
    depNode.getChildren().add(empLeaf);
    found = true;
    break;
    if (!found) {
    TreeItem<String> depNode = new TreeItem<String>(
    employee.getDepartment(),
    new ImageView(depIcon)
    rootNode.getChildren().add(depNode);
    depNode.getChildren().add(empLeaf);
    stage.setTitle("Tree View Sample");
    VBox box = new VBox();
    final Scene scene = new Scene(box, 400, 300);
    scene.setFill(Color.LIGHTGRAY);
    TreeView<String> treeView = new TreeView<String>(rootNode);
    treeView.setEditable(true);
    treeView.setCellFactory(new Callback<TreeView<String>,TreeCell<String>>(){
    @Override
    public TreeCell<String> call(TreeView<String> p) {
    return new TextFieldTreeCellImpl();
    box.getChildren().add(treeView);
    stage.setScene(scene);
    stage.show();
    private final class TextFieldTreeCellImpl extends TreeCell<String> {
    private TextField textField;
    public TextFieldTreeCellImpl() {
    @Override
    public void startEdit() {
    super.startEdit();
    if (textField == null) {
    createTextField();
    setText(null);
    setGraphic(textField);
    textField.selectAll();
    @Override
    public void cancelEdit() {
    super.cancelEdit();
    setText((String) getItem());
    setGraphic(getTreeItem().getGraphic());
    @Override
    public void updateItem(String item, boolean empty) {
    super.updateItem(item, empty);
    if (empty) {
    setText(null);
    setGraphic(null);
    } else {
    if (isEditing()) {
    if (textField != null) {
    textField.setText(getString());
    setText(null);
    setGraphic(textField);
    } else {
    setText(getString());
    setGraphic(getTreeItem().getGraphic());
    private void createTextField() {
    textField = new TextField(getString());
    textField.setOnKeyReleased(new EventHandler<KeyEvent>() {
    @Override
    public void handle(KeyEvent t) {
    if (t.getCode() == KeyCode.ENTER) {
    commitEdit(textField.getText());
    } else if (t.getCode() == KeyCode.ESCAPE) {
    cancelEdit();
    private String getString() {
    return getItem() == null ? "" : getItem().toString();
    public static class Employee {
    private final SimpleStringProperty name;
    private final SimpleStringProperty department;
    private Employee(String name, String department) {
    this.name = new SimpleStringProperty(name);
    this.department = new SimpleStringProperty(department);
    public String getName() {
    return name.get();
    public void setName(String fName) {
    name.set(fName);
    public String getDepartment() {
    return department.get();
    public void setDepartment(String fName) {
    department.set(fName);
    Edited by: 882590 on May 22, 2012 8:24 AM
    Edited by: 882590 on May 22, 2012 8:24 AM

    When you click on a selected tree item to start the edit process is the text in the text field selected? In my case the text is not selected and the focus is not on the text field so I have to click in the text field before I can make a change, which makes it seem as if the method call textfield.selectAll() is ignored or something else gets focus after method startEdit() executes.

  • Dynamic tree structure (expand/collapse)

    i want to do one tree struc example (expand /collapse)
    using xml;
    like
    WOrld
    |
    |
    ----INDIA
    |
         -------Andhrapradesh
    |
              |
    -----------------Hyderabad
              |               |                         |           Visakhapatnam
              Karnataka
    |
              |                    
    Tamilnadu
    America
    |
    Australia
    in the frame at left side tree structure will be there ;when i click world hyperlink and at the right side one forum will come like this;
    country name ---------
    description ---------
    when i enter america and enter submit;the country should come in the left frame;i will refresh left frame when click submit;ofcourse i know that;like wise when i click state hyperlink
    state name ---------
    description ---------
    statename should come under state tree node;
    i will also maintain this info in database also;i am using oracle9i;how can i do this the tree structure;how to approach;if anybody give me any links revelant to this?atleast give me some idea what to do?please dont give me the DOM tutorial or SAX Tutorial cos i already gone through but i didnt get any idea.
    bye
    chaitanya

    Initailly set xerces.jar (parser, freeware download from apache site) to calss path
    Suppose
    <WORLD>
    <INDIA>
    <ANDHRA>abc</ANDHRA>
    <VISHAKHA>fsdfd</VISHAKHA>
    <UP>dss</UP>
    </INDIA>
    <USA>
    <FLORIADA>bsbs</FLORIADA>
    <NEWYORK>dsds</NEWYORK>
    </USA>
    </WORLD>
    try{
    dbf = DocumentBuilderFactory.newInstance();
    db = dbf.newDocumentBuilder();
    mapDocument = db.newDocument();
    Element worldElement = mapDocument.createElement("WORLD");
    Element indiaElement = mapDocument.createElement("INDIA");
    Element andhraElement = mapDocument.createElement("ANDHRA");
    andhraElement.appendChild(mapDocument.createTextNode("sdsd");
    Element vishakhaElement = mapDocument.createElement("VISHKHA");
    vishkhaElement.appendChild(mapDocument.createTextNode("sdfdf");
    Element upElement = mapDocument.createElement("UP");
    upElement.appendChild(mapDocument.createTextNode("fsfs");     
    indiaElement.appendChild(andhraElement)
         .appendChild(vishkhaElement)
         .appendChild(upYElement)
    //lly do for usaELement
    //finally add indiaElemebnt and usaElement to worldElement                    
    worldElement.appendChild(indiaElement)
         .appendChild(usaElement)
    mapDocument.appendChild(worldElement);          
    }catch(FactoryConfigurationError fce){
         fce.printStackTrace();
    }catch(ParserConfigurationException pce){
    pce.printStackTrace();
    I think this u need

  • Tree and auto collapse

    Hi
    I had an old Actionscript code that works with a Tree
    component.
    The idea is that when you open an Branch, it collapses before
    the already opened ones, so you have only branch at the same time.
    I try to reproduce it with a flex component but if I use
    expandItem(), the Tree opens suddenly without the slow motion
    provided when you close to the arrow.
    The functions used in Flash were getIsOpen() and setIsOpen()
    Is there a similar way to do that in Flex ?
    Thanks for your help

    I made that code, but the expandItem is not working. I know I
    have to use the dataProvider and not the Tree itself and it should
    work like that. I followed
    that
    tutorial.
    Thanks for your help

  • How to expand all the nodes in a tree while loading the tree initially

    Hi All
    Now i am able to display the tree strucute in webdynpro.
    but it is displaying the tree initially in collapsed mode until/unless we click on the node root it will be expanded.
    but my requirement is i wanted to display the tree in expanded mode by default at runtime initially.
    can you please provide any setting to be done or any sample code on the same then it would be great help to me.??
    Thanks
    Trisha

    Hi,
    isLeaf is an attribute you need to create under "CatalogEntries" node. And "isRoot" is not requried.
    Download the sample project "TutWD_TreeByNestingTableColumn". See the below link to dnld this project.
    https://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/503f22f6-b978-2a10-bf97-ddc21267e752 [original link is broken]
    Do the changes in sample project as below:
    Invoke this method in the init method as below (as it is in the same project).
    addCatalogEntries(wdContext.nodeCatalogEntries(), "ROOT");
    Change the code in addCatalogEntries() method as below.
    Here we are calling the addCatalogEntries() method recursively for all the parent elements and we are changing the  setExpanded property to true.
    public void addCatalogEntries( com.sap.tut.wd.treetable.wdp.IPrivateTreeTableView.ICatalogEntriesNode node, java.lang.String parentId )
    //@@begin addCatalogEntries()
    IPrivateTreeTableView.ICatalogEntriesElement newCatalogEntriesElement;
    for (int i = 0; i < Catalog.getLength(); i++) {
    if (parentId.equals(Catalog.getParentId(i))) {
    // create new context node element
    newCatalogEntriesElement = node.createCatalogEntriesElement();
    node.addElement(newCatalogEntriesElement);
    // provide node elements with data
    newCatalogEntriesElement.setID(Catalog.getCATALOGID(i));
    newCatalogEntriesElement.setTITLE(Catalog.getTITLE(i));
    newCatalogEntriesElement.setDESCRIPTION(Catalog.getDESCRIPTION(i));
    newCatalogEntriesElement.setAMOUNT(Catalog.getAMOUNT(i));
    if ("ARTICLE".equals(Catalog.getCATALOGTYPE(i))) {
    // checkbox is visible by default
    newCatalogEntriesElement.setPUBLISHED(Catalog.getPUBLISHED(i));
    // third level is last level
    newCatalogEntriesElement.setIsLeaf(true);
    } else {
    // a CATEGORY does not use the checkbox column
    newCatalogEntriesElement.setUsageOfPublishedAttribute(WDVisibility.BLANK);
    newCatalogEntriesElement.setIsLeaf(false);
    newCatalogEntriesElement.setChildrenLoaded(true);
    newCatalogEntriesElement.setExpanded(true);
    addCatalogEntries(newCatalogEntriesElement.nodeChildCatalogEntries(),newCatalogEntriesElement.getID());

Maybe you are looking for