Htmlb:tree

Hi,
I created a BSP application with dynamic htmlb:tree using TVIEW2.  Everything works fine BUT...  when I navigate to another page and I return to the page containing the tree-object, my tree is no longer displayed, although the internal table TVIEW2 is properly filled.  Anyone experienced this problem also???  Possible solution?

What exactly happens?
Is nothing at all displayed?
Can you post some coding?

Similar Messages

  • How to change color of htmlb tree...

    Hi, I am analyzing the htmlb tree tag, and wondering how I can change the color of each row, or change the color of the whole tree white?  I know about the style editor, but I'm looking for a way code-wise to make this change.  I have pasted code below for your reference.  Any help or styling tips would be very appreciated!
    Thank you so much! Baggett
    <b>   <hbj:tree id="S_Tree" title="e-enviroment" tooltip="enviroment of my computer">
               <hbj:treeNode id="e_root" text="Desk" isOpen="true" tooltip="My desk">
                   <hbj:treeNode id="e_comp" text="Computer" isOpen="true">
                        <hbj:treeNode id="e_comp_fl" text="Floppy"/>           
                      </hbj:treeNode>
                   <hbj:treeNode id="e_net" text="Network" isOpen="true" tooltip="Company network">
                        <hbj:treeNode id="n_lan" text="LAN" tooltip="Local Area Network"/>                 
                    </hbj:treeNode>
               </hbj:treeNode>
       </hbj:tree></b>

    What rajesh suggested won't work.
    <hbj:tree id="S_Tree" title="e-enviroment" tooltip="enviroment of my computer">
    <%
      S_tree.setEncode(false);
      S_tree.setText("<span style=background-color: #FFFF00>e-enviroment</span>");
    %>
    <hbj:treeNode id="e_root" text="Desk" isOpen="true" tooltip="My desk">
    <%
      e_root.setEncode(false);
      e_root.setText("<span style=background-color: #FFFF00>Desk</span>");
    %>
    <hbj:treeNode id="e_comp" text="Computer" isOpen="true">
    <%
      e_comp.setEncode(false);
      e_comp.setText("<span style=background-color: #FFFF00>Computer</span>");
    %>
    <hbj:treeNode id="e_comp_fl" text="Floppy"/>
    </hbj:treeNode>
    <hbj:treeNode id="e_net" text="Network" isOpen="true" tooltip="Company network">
    <%
      e_net.setEncode(false);
      e_net.setText("<span style=background-color: #FFFF00>Network</span>");
    %>
    <hbj:treeNode id="n_lan" text="LAN" tooltip="Local Area Network"/>
    </hbj:treeNode>
    </hbj:treeNode>
    </hbj:tree>
    Message was edited by: Prakash  Singh

  • Htmlb:tree differentiate between nodeclick and tree node expander click

    Hi,
    how can i differentiate between nodeclick and tree node expander (to get to its children) click in my event processing in htmlb:tree element.
    <u><b>What i am trying to achieve?</b></u>
    Onload just load root node and its immediate children.
    On node expand get the children of the current node and modify htmlb:tree table2 with additional node inofs.
    on node click  call some client function.
    But my issue is that i am not able to differentiate between node expander click and node click in my event handling. Any help on this is appreciated.
    (I am not using MVC)
    Thanks in advance.
    Regards
    Raja
    Message was edited by: Durairaj Athavan Raja

    After reading your weblog I think I understand better. I did some testing with my example.  I am using the toggle = "true", so that the page returns to the server each time an expander is selected.
    <htmlb:tree id          = "myTree1"
                  height      = "75%"
                  toggle      = "true"
                  title       = "<b><otr>EQI Reporting Tree</otr></b>"
                  width       = "90%"
                  onTreeClick = "myTreeClick"
                  table       = "<%= application->selection_model->itview                             %>" >
      </htmlb:tree>
    However I have not added any coding in my event handler to respond to the expander event.  I only respond to myTreeClick (which loads some data for the given selection).  The BSP tree element itself must be doing the hard work for me. 
      if event_id cs 'tr_myTree1'.
        data: tree_event type ref to cl_htmlb_event_tree.
        tree_event ?= htmlb_event.
        if tree_event->server_event = 'myTreeClick'.
          clear appl->message1.
          appl->selection_model->get_chart_data( appl = appl
                                                 node = tree_event->node ).
        endif.
      endif.
    I pass my entire tree defintion to the element.  It appears that it only sends visible nodes to be rendered. When the expander is selected, I don't have to do anything, the tree re-renders with only the newly visible rows. 
    I tested and turned off the toggle (toggle = "false") and my page took forever to load because it was sending all the nodes to the frontend on the first load.

  • How to: display the pcd in a htmlb tree object?

    Hello @ all,
    I'm currently trying to implement the contents of the PCD into a htmlb tree structure for an application of mine.
    while the tree creation isn't a problem, i have no idea where to start on how to read/parse the pcd structure.
    the reason for me trying to stuff the pcd into a tree is to achieve an easier to handle navigation.
    so of anybody could point me in the right direction as how to get access to the pcd porperly and how to get the complete pcd structure (folder, iviews, everything) so that i could include it in the tree, i would be really thankful.
    cheers,
    jürgen

    Hi Jürgen,
    See http://help.sap.com/saphelp_nw04/helpdata/en/44/6aaf92f5a23672e10000000a114a6b/frameset.htm
    Only Worksets and Roles are not described, anyhow, doing a bit research via decompiling or just by searching on SDN will bring you the needed extra info; just as an example for roles access: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6112ecb7-0a01-0010-ef90-941c70c9e401
    Hope it helps
    Detlev

  • RestoreViewState  with HTMLB-TREES/TREENODES

    Hello,
    we want to achieve that our dynamic tree will
    be built up in the state it was before we jumped onto another page. When navigating backwards, the tree
    does not remember any more it treenodes properties.
    Just the root is displayed, not any more the information which node was open and which not.
    Also restoreViewState  = "TRUE" did not help.
    Any ideas ?
    Thanks.

    Here is a complete (yet simplistic) example that proves that the serialization idea works.
    Stateless Application
    Page One called tree.htm
    Page Attributes (Auto Flag is NOT set)
    h1_isopen     TYPE     STRING
    h2_isopen     TYPE     STRING
    view_state     TYPE     SHSVALTAB
    OnInitialization
    * event handler for data retrieval
    DATA: istream TYPE string,
             xslt_err TYPE REF TO cx_xslt_exception.
    **** Read Server cookie
    CALL METHOD cl_bsp_server_side_cookie=>get_server_cookie
       EXPORTING
         name                  = 'view_state'
         application_name      = runtime->application_name
         application_namespace = runtime->application_namespace
         username              = sy-uname
         session_id            = runtime->session_id
         data_name             = 'view_state'
       CHANGING
         data_value            = istream.
    **** deserialize the Class
    IF istream IS NOT INITIAL.
       TRY.
           CALL TRANSFORMATION id
           SOURCE XML istream
           RESULT view_state = view_state.
         CATCH cx_xslt_exception INTO xslt_err.
       ENDTRY.
    ENDIF.
    CHECK view_state IS NOT INITIAL.
    FIELD-SYMBOLS: <wa_state> LIKE LINE OF view_state.
    LOOP AT view_state ASSIGNING <wa_state>.
       IF <wa_state>-key CS 'Header1'.
         IF <wa_state>-value = 'O'.
           h1_isopen = 'TRUE'.
         ENDIF.
       ENDIF.
       IF <wa_state>-key CS 'Header2'.
         IF <wa_state>-value = 'O'.
           h2_isopen = 'TRUE'.
         ENDIF.
       ENDIF.
    ENDLOOP.
    OnInputProcessing
    * event handler for checking and processing user input and
    * for defining navigation
    DATA: fields TYPE tihttpnvp.
    request->get_form_fields( CHANGING fields = fields ).
    FIELD-SYMBOLS: <wa_field> LIKE LINE OF fields,
                   <wa_state> LIKE LINE OF view_state.
    LOOP AT fields ASSIGNING <wa_field>.
      IF <wa_field>-name CS 'test'. "My Tree ID
        APPEND INITIAL LINE TO view_state ASSIGNING <wa_state>.
        <wa_state>-key   = <wa_field>-name.
        <wa_state>-value = <wa_field>-value.
      ENDIF.
    ENDLOOP.
    DATA: ostream TYPE string,
            xslt_err TYPE REF TO cx_xslt_exception.
    ***** serialize model class
    TRY.
        CALL TRANSFORMATION id
        SOURCE view_state = view_state
        RESULT XML ostream.
    ****Write cookie it into the Server Cookie
        cl_bsp_server_side_cookie=>set_server_cookie( name = 'view_state'
          application_name = runtime->application_name
          application_namespace = runtime->application_namespace
          username = sy-uname
          session_id = runtime->session_id
          data_name = 'view_state'
          data_value = ostream
          expiry_time_rel = '1200' ).
      CATCH cx_xslt_exception INTO xslt_err.
    ENDTRY.
    navigation->goto_page( 'Navigate.htm' ).
    Layout of tree.htm
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title=" " >
        <htmlb:form>
          <htmlb:tree id               = "test"
                      restoreViewState = "TRUE" >
            <htmlb:treeNode id     = "Header1"
                            text   = "Header1"
                            isOpen = "<%= h1_isopen %>" >
              <htmlb:treeNode id     = "Header2"
                              text   = "Header2"
                              isOpen = "<%= h2_isopen %>" >
                <htmlb:treeNode id   = "Item1"
                                text = "Item1" />
                <htmlb:treeNode id   = "Item2"
                                text = "Item2" />
              </htmlb:treeNode>
              <htmlb:treeNode id   = "Item3"
                              text = "Item3" />
              <htmlb:button text    = "test"
                            onClick = "TEST" />
            </htmlb:treeNode>
          </htmlb:tree>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Second Page Navigate.htm (Just a dummy page to simulate Navigation)
    OnInputProcessing
    * event handler for checking and processing user input and
    * for defining navigation
    navigation->goto_page( 'tree.htm' ).
    Layout for Navigate.htm
    <%@page language="abap"%>
    <%@extension name="htmlb" prefix="htmlb"%>
    <htmlb:content design="design2003">
      <htmlb:page title = " ">
        <htmlb:form>
          <htmlb:textView     text          = "Hello World!"
                              design        = "EMPHASIZED" />
          <htmlb:button       text          = "Press Me"
                              onClick       = "myClickHandler" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>

  • Htmlb:tree: Expand All

    I tried to implement an "Expand All" functionality for my htmlb:tree. Strangely, I can change the nodes in the tree table, but they are still displayed as closed on the screen.
    LOOP AT me->t_tree ASSIGNING <fs> WHERE status = cl_htmlb_treenode=>c_treenode_closed
                                             OR toggle = cl_bdv_co=>c_true.
          <fs>-status = cl_htmlb_treenode=>c_treenode_open.
          <fs>-toggle = cl_bdv_co=>c_false.
    ENDLOOP.
    Why is this? Has this anything to do with the TOGGLE functionality of the tree (which loads certain subtrees with a new server event) ?

    >Has anybody an explanation for this
    Delta-Handling is half Black Magic Voodoo anyway.  I assume that the DH server side cache doesn't see any change in those fields (since you have removed them) and therefore doesn't resend them to the client (it only sends changed values).
    The Client side cache still has the old values in memory and didn't get an update from the server.  Therefore it still renders the old values.
    You might try placing a delta handler block around your tree coding:
    <bsp:deltaHandlerBlock id="protectionR2" >
        <htmlb:tree ... />
    </bsp:deltaHandlerBlock>
    You can try playing with the attributes of the DHBlock.  Try attribute clientCacheClear when you want force a change to the tree.

  • Htmlb:tree node count limitation

    Hi Experts,
    I have a problem with htmlb:tree. Rendering up to 60 nodes will works well, if my tree has more than 60-65  nodes and I klick any link or the tree itself, after rendering has been finished, the Browser will get stuck and keep searching forever. SAP recommends to use htmlb:tree for trees with 30-50 nodes. Some suggestion was to load the node using AJAX. Are there some other ideas?
    Many thanks for help!

    check out this weblog
    [BSP/How-To: Build performance-efficient dynamic htmlb:tree|BSP/How-To: Build performance-efficient dynamic htmlb:tree]
    Raja

  • Create columns for HTMLB:TREE

    Hi All,
    In our appplication we are are using <htmlb:tree />. Using CL_BSP_BEE_TABLE we were able to show checkbox inside the tree node. CL_BSP_BEE_TABLE was of great help.
    Now we need columns in tree. Is there a way to create columns using BEE?
    Thanks and regards,
    Bindiya

    I am using a tree with about 2500 nodes and and around 5000 final children (leaves)  and we dont face any problem using the approach i have explained in my weblog.
    i guess the best approach would be to just do it and check whether you are having problem.
    <i>Do you know of any good alternatives to the htmlb:tree?</i>
    there are other javascrip/dhtml trees but you will still face the same kind of issues.
    Regards
    Raja

  • Bsp htmlb:tree

    Hi,
    I created a BSP application with dynamic htmlb:tree using TVIEW2. Everything works fine BUT... when I navigate to another page and I return to the page containing the tree-object, my tree is no longer displayed, although the internal table TVIEW2 is properly filled. Anyone experienced this problem also??? Possible solution?

    Layout:
        <myhtmlb:gridLayoutCell columnIndex = "1"
                                rowIndex    = "1" >
          <%-- Overview tree --%>
          <myxhtmlb:overflowContainer height = "495"
                                      width  = "350"
                                      mode   = "SCROLL" >
            <myhtmlb:tree id               = "TREE_PROP"
                          onTreeClick      = "OnInputProcessing"
                          restoreViewState = "TRUE"
                          height           = "495"
                          width            = "350"
                          table2           = "<%= i_tree %>"
                          title            = "Personnel Overview" />
          </myxhtmlb:overflowContainer>
        </myhtmlb:gridLayoutCell>
    internal table i_tree is filled in OnInitialization event. The table is proporly filled.

  • HtmlB tree context menu

    Hi guys,
    do you if it is possible to add a context menu on an htmlb tree?
    regards,
    Marc

    Hi Marc,
         You can use the hover menu which works as a context menu.
    The below code is just a sample.
    TreeNode name1 = new TreeNode(strid, strtext, name);
    //you to have build the hovermenu
    HoverMenu menu = new HoverMenu("test");
    name1.setHoverMenu(menu);

  • Html in htmlB Tree Title

    We're moving our portal apps from ep6.20 onto Netweaver SP12, and I've found several htmlB components that no longer seem to accept Html in various "text" settings (Tree Title and TableView Header notably)--the HtmlB component seems to always encode the text.
    Does anyone know of a way to include Html in a Tree Title? 
    TableView provides a HeaderRenderer, which is an acceptable workaround for that component.  Are there any known workarounds for Tree Title?
    Thanks,
    Curt

    Hi Prakash
    That's sort of the approach I've taken for now.  I'm currently writing html as the content for other nodes, so this was the solution that came immediately to mind.  However, it appears that even if you set
    root.setShowExpander(false);
    , the expander always shows.  Goal was to have non-expandable "title" for tree.  May need to consider wrapping the tree in a Group.
    Thanks for the suggestion,
    Curt

  • htmlb:tree : Node IDs not unique - error handling

    From an internal table of customers and contact persons, I made a tree using TVIEWNODE2 structure. Some of the customers are not having contact persons for which contact person ids are simply '00000000'. Thus these nodes may not be unique here. Somehow everything is working fine but sometimes I am getting the above error mentioned in subject.
    Actually I have a tabstrip and one of the items of tabstrip contains tree. The occurrence of this error is not at all uniform , sometimes it works and sometimes don't. It's very difficult to find when and why it's triggered. In the same situation and circumstances sometimes it works and sometimes doesn't.Appearance of this error is irrespective of whether tree is operated or any other event is handled.
    Can anybody throw light on this? Thanks in advance.

    hi thomas
    you are absolutely correct when you say that the error occurs in the second request cycle. do i need to clear the tree table then?
    As you said , if the application is stateful, the best place is 'On create' event to write the code. But my application is stateless and that is why I am hesitant to put the code in 'On create' and rather placed it in 'On request' event where I am getting the cookie of internal table from which I am preparing tree table.
    So, I think keeping the code in 'On request' as before but ensuring that the table is cleared everytime will solve the problem. But let me check this and tell you.
    I am very thankful for your quick replies and focussing on my problem. thanks a lot.
    I will let you know the outcome soon.
    regards
    jawahar

  • Problem with trees in MiniWas

    Hello all,
    I'm trying to build two tree in a same page.
    The problem is that all  menus in the first tree are displayed again in the second tree before the new menus.
    Has anyone met the problem and solved it ?
    Thnks a lot in advance !
    Sebastien

    OK, here is my code:
    <!-- CASE "Liens généraux" -->
    <htmlb:tray id                = "liens"
                width             = "100%"
                design            = "borderless"
                hasContentPadding = "false"
                hasMargin         = "false"
                title             = "Liens" >
    <htmlb:tree id        = "tree1"
                 height    = "100%"
                 toggle    = "false"
                 showTitle = "false"
                 width     = "100%" >
    <htmlb:treeNode id     = "tree1_node1"
                     text   = "Liens"
                     isOpen = " " >
    <htmlb:treeNode id     = "link1"
                     link   = "http://www.google.fr"
                     target = "main"
                     text   = "Google" />
    <htmlb:treeNode id     = "link2"
                     link   = "http://www.mappy.fr"
                     target = "main"
                     text   = "Mappy" />
    <htmlb:treeNode id     = "link3"
                     link   = "http://www.afp.fr"
                     target = "main"
                     text   = "A F P" />
    </htmlb:treeNode>
    <htmlb:treeNode id     = "tree1_node2"
                     text   = "Liens SAP"
                     isOpen = " " >
    <htmlb:treeNode id     = "link4"
                     link   = "http://service.sap.com"
                     target = "main"
                     text   = "SAP Service MarketPlace" />
    <htmlb:treeNode id     = "link5"
                     link   = "http://www.sdn.sap.com"
                     target = "main"
                     text   = "SAP Developer Network" />
    <htmlb:treeNode id     = "link6"
                     link   = "http://help.sap.com/"
                     target = "main"
                     text   = "SAP Help Portal" />
    </htmlb:treeNode>
    </htmlb:tree>
    </htmlb:tray>
    <!-- FIN DE LA CASE "Liens généraux" -->
    <!-- CASE "Activités" -->
    <htmlb:tray id                = "activites"
                width             = "100%"
                design            = "borderless"
                hasContentPadding = "false"
                hasMargin         = "false"
                title             = "Activités" >
    <htmlb:tree id        = "tree2"
                 height    = "100%"
                 toggle    = "false"
                 showTitle = "false"
                 width     = "100%" >
    <htmlb:treeNode id     = "tree2_node1"
                     text   = "Fonctions"
                     isOpen = "X" >
    <htmlb:treeNode id     = "link7"
                     link   = "page_1.htm"
                     target = "main"
                     text   = "Réceptionner" />
    <htmlb:treeNode id     = "link8"
                     link   = "page_2.htm"
                     target = "main"
                     text   = "Catalogue des produits" />
    <htmlb:treeNode id     = "link9"
                     link   = "page_3.htm"
                     target = "main"
                     text   = "Suivi des livraisons" />
    </htmlb:treeNode>
    </htmlb:tree>
    </htmlb:tray>
    <!-- FIN DE LA CASE "Activités" -->
    THANKS TO ALL !
    Cheers
    Sebastien

  • How to raise a pop-up page using HTMLB

    Hi friends,
       Can anybody tell me how  to raise a pop-up page using HTMLB.But don't use webdynpro.
    I want to set a TextField  on PAGE A,and a button ,when i click the button,
    it raise up a page B,Page B contains a HTMLB tree,when i click the tree node,
    The textfield value in Page A will get the node text.
    waiting for your great help!

    Hi Raven,
    In case of HTMLB you can use javascript to pop up the new page on click of the button.
    onClientClick="popUpMethod();" of button call a java script method popUpMethod(). which will call the other page. below is the code for opening other page as pop up
    function popUpMethod(){
              window.open("T1Report.htm",'_blank',
          " status=yes,toolbar=yes,menubar=yes,location=no, scrollbars=yes ");     
    in this method you just need to change the name of your htmlb page like T1Report.htm with your html page.
    please revert if you require more information
    Regards'
    Narendra

  • BSP Tree View - how to create checkboxes on each node?

    Hello all,
    On my (non-MVC) BSP page I'd like to have a tree in which each node has a checkbox that the use can select, e.g. node 1.1: X, node 1.2: space; node 1.3: X
    It doesn't seem like the standard <htmlb:tree> can do this. Is there any quick way I can achieve this functionality?
    Any suggestions/code samples will be appreciated.
    Rgds,
    Louis.

    Hi Louis,
    Go through the sample program which is exactly as per your requirement,
    http://www.sapdevelopment.co.uk/webapps/bsp/bsp_orgunit.htm
    Regards,
    Azaz Ali.

Maybe you are looking for