How to Use Tree Structure in Forms (Expand & Collpse)

Hi ,
I need a logic to develop a Custom form which using tree structure fuctionality.It's like same in Indented Bills form (Module Bills of Material).
I have to use the symbol '+' and '-' in column called item_number ( if it has sub componentes, using that symbol i may explode or collopse).
I gone through the base form for that(indented Bill form(Form Name:BOMFQBIN, using BOMFMSTR library function to create Tree Structure)
but i colud not understand the logic.
If any one clarify me then it's fine
Thanks,
Sri

see this thread
Re: Forms 60 Heirarchical Tree..Need Help

Similar Messages

  • How to populate Tree structure from BAPI while tree grows or shrinks

    Hi All
    Currently I am populating the tree structure from BAPI based on the HLevel (Hierarchy  Level) parameter, but when ever insertion and deletion happens in the tree at any level in the UI and at the same time i am updating these tree node values with HLevel value(example : 1 is first level , 2 is second level, 3 is third level etc)  updating successfully& correctly  into the BAPI, no issues.
    Once it is updated into the BAPI, next time when i refreshed the UI then i am not populating the tree structure correctly from BAPI with updated new nodes based on the HLevel. when tree struture grows or shrinks in the BAPI after updating into BAPI from UI then i am not populating the tree sturcture correctly based on the HLevel value from the BAPI.
    Please let me know any sample code how to populate tree structure correctly when tree structure grows or shrinks based on the HLevel value ( Hierarchy Level , for example : 1 is level , 2 is 2nd level , 3 is third level nodes etc)
    anybody helps in this regard with sample code on the populating tree tructure then it would be great help to me.
    Thanks in advance
    Regards
    Kalki Reddy
    Edited by: KalkiReddy on Nov 29, 2009 3:48 PM

    Bapi output node:
    Value     | Text     | HLevel
    01     | A     | 1               
    0101     | AA       | 2
    010101     | AAA     | 3
    01010B     | AAB     | 3
    0102     | AB     | 2
    02     | B     | 1
    0201     | BA        | 2
    This code is used to build the tree in wdDoInit method
         IE_T_CatalogueNode catalogueNode = wdContext.nodeE_T_Catalogue();
         int size = catalogueNode.size();
         ICatalogoElement level1elem = null;
         for (int i = 0; i < size; i ++)
              IE_T_CatalogueElement catalogueElem = catalogueNode.getE_T_CatalogueElementAt(i);
              if (catalogueElem.getLevel().equals("1"))
                   // 1 Livello
                   level1elem = wdContext.createCatalogoElement();
                   level1elem.setKATALOGART_CODE(catalogueElem.getKatalogart());
                   level1elem.setCODEGRUPPE_CODE(catalogueElem.getCodegruppe());
                   level1elem.setCODE(catalogueElem.getCode());
                   level1elem.setCODE_DESCR(catalogueElem.getKatalogart_Descr());
                   level1elem.setDESCR(catalogueElem.getKatalogart_Descr());
                   wdContext.nodeCatalogo().addElement(level1elem);
                   for (int j = i + 1; j < size; j ++)
                        IE_T_CatalogueElement catalogueElem2level =
                                                 catalogueNode.getE_T_CatalogueElementAt( j );
                        String level2 = catalogueElem2level.getLevel();
                        if (level2.equals("2"))
                             ICatalogoElement level2elem = level1elem.nodeChild().createCatalogoElement();
                             level2elem.setKATALOGART_CODE(catalogueElem2level.getKatalogart());
                             level2elem.setCODEGRUPPE_CODE(catalogueElem2level.getCodegruppe());
                             level2elem.setCODE(catalogueElem2level.getCode());
                             level2elem.setCODE_DESCR(catalogueElem2level.getCodegruppe_Descr());
                             level2elem.setDESCR(catalogueElem2level.getCodegruppe_Descr());
                             level1elem.nodeChild().addElement(level2elem);
                             for (int k = j + 1; k < size; k ++)
                                  IE_T_CatalogueElement catalogueElem3level =
                                                           catalogueNode.getE_T_CatalogueElementAt( k );
                                  String level3 = catalogueElem3level.getLevel();
                                  if (level3.equals("3"))
                                       ICatalogoElement level3elem = level2elem.nodeChild().createCatalogoElement();
                                       level3elem.setKATALOGART_CODE(catalogueElem3level.getKatalogart());
                                       level3elem.setCODEGRUPPE_CODE(catalogueElem3level.getCodegruppe());
                                       level3elem.setCODE(catalogueElem3level.getCode());
                                       level3elem.setCODE_DESCR(catalogueElem3level.getCode_Descr());
                                       level3elem.setDESCR(catalogueElem3level.getCode_Descr());
                                       level2elem.nodeChild().addElement(level3elem);
    Damiano

  • How to use the structure in the EXIT_SAPMM06E_013 function module

    Hello Experts,
    Please guide me how to use the structure defined in function modules under  table tab in the driver program for smart form to fetch the data. Please post some sample code if available.
    Best Regards,
    Sandesh.Sreyamsh

    Can you please elaborate little bit more what is the actual requirement?

  • How to declare custom structure in form interface in smartforms?

    Hi,
    How to declare custom structure in form interface in smartforms?
    Thanks.

    Create a structure in SE11 and use that in Form Interface - > Tables tab in smartforms.
    Pranav

  • [Forum FAQ] How to use parameter to control the Expand/Collapse drill-down options in SSRS report?

    In SQL Server Reporting Services (SSRS), drill-down is an action we can apply to any report item to hide and show other report items. They all are ways that we can organize and display data to help our users understand our report better. In this article,
    we are talking about how to use parameter to control the Expand/Collapse drill-down options in SSRS report.
    Consider that the report has a dataset (dsSales) with following fields: SalesTerritoryGroup, SalesTerritoryCountry, CalendarYear, SalesAmount.
    1. The report has the following group settings:
    Parent Group: SalesTerritoryGroup
     Child Group: SalesTerritoryCountry
      Child Group: CalendarYear
       Details: SalesAmount
    2. Add three parameters in the report:
    GroupExpand:
    Available Values: “Specify values”
    Label: Yes           Value: Yes
    Label: No            Value: No
    Default Values: “Specify values”
    Value: Yes
    CountryExpand:
    Available Values: “Specify values”
    Label: Yes           Value: =IIF(Parameters!GroupExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No","No","Yes")
    YearExpand:
    Available Values: “Specify values”
    Label: Yes          
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No","No","Yes")
    3. Right click SalesTerritoryCountry icon in the Row Groups dialog box, select Group Properties.
    4. Click Visibility in the left pane. Select “Show or hide based on an expression” and type with following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", False, True)
    Select “Display can be toggled by this report item” option, and select “SalesTerritoryGroup” in the drop down list.
    5. Use the same method setting CalendarYear, (Details) drill-down with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", False, True)
    =IIF(Parameters!YearExpand.Value="Yes", False, True)
    6. Click SalesTerritoryGroup text box in the tablix. Select InitialToggleState property in the Properties dialog box, and type following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", True, False)
    7. Use the same method setting SalesTerritoryCountry, CalendarYear text box with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", True, False)
    =IIF(Parameters!YearExpand.Value="Yes", True, False)
    After that, when we preview the report, we can use these three parameters to expand/collapse drill-down.
    Note:
    In our test, we may meet following issue. We can check the expression of InitialToggleState property to troubleshooting the issue.
    Applies to
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012

    In SQL Server Reporting Services (SSRS), drill-down is an action we can apply to any report item to hide and show other report items. They all are ways that we can organize and display data to help our users understand our report better. In this article,
    we are talking about how to use parameter to control the Expand/Collapse drill-down options in SSRS report.
    Consider that the report has a dataset (dsSales) with following fields: SalesTerritoryGroup, SalesTerritoryCountry, CalendarYear, SalesAmount.
    1. The report has the following group settings:
    Parent Group: SalesTerritoryGroup
     Child Group: SalesTerritoryCountry
      Child Group: CalendarYear
       Details: SalesAmount
    2. Add three parameters in the report:
    GroupExpand:
    Available Values: “Specify values”
    Label: Yes           Value: Yes
    Label: No            Value: No
    Default Values: “Specify values”
    Value: Yes
    CountryExpand:
    Available Values: “Specify values”
    Label: Yes           Value: =IIF(Parameters!GroupExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No","No","Yes")
    YearExpand:
    Available Values: “Specify values”
    Label: Yes          
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No","No","Yes")
    3. Right click SalesTerritoryCountry icon in the Row Groups dialog box, select Group Properties.
    4. Click Visibility in the left pane. Select “Show or hide based on an expression” and type with following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", False, True)
    Select “Display can be toggled by this report item” option, and select “SalesTerritoryGroup” in the drop down list.
    5. Use the same method setting CalendarYear, (Details) drill-down with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", False, True)
    =IIF(Parameters!YearExpand.Value="Yes", False, True)
    6. Click SalesTerritoryGroup text box in the tablix. Select InitialToggleState property in the Properties dialog box, and type following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", True, False)
    7. Use the same method setting SalesTerritoryCountry, CalendarYear text box with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", True, False)
    =IIF(Parameters!YearExpand.Value="Yes", True, False)
    After that, when we preview the report, we can use these three parameters to expand/collapse drill-down.
    Note:
    In our test, we may meet following issue. We can check the expression of InitialToggleState property to troubleshooting the issue.
    Applies to
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012

  • How to use "Reference Structure" setting in analysis grid item

    Hello expert,
            in Bex analyzer, how to use "Reference Structure" setting in analysis grid item by example?
    Many thanks,

    The variable needs assigned a value, that's why you're getting prompted. When you execute the statement, it's not executing the variable and exec lines.
    Having script output available in a grid would be an enhancement request.

  • How to use css in oracle forms

    Hello,       I am using oracle forms 11g with weblogic server 10.3.5 at windows 7.I have to use CSS in oracle forms.i have tried to search it but no profit.please some one else tell me that how can use css in oracle forms. Thnak You regards aaditya

    Hi
    As Francois pointed out Oracle forms has nothing to do with html based technology. The way you can get the equivalent effect of creating consistancy in the way your objects are displayed is by creating a set of items you want and alter their apperance and behaviour and place them into object libraries (one library should do the trick).  From there you subclass all of you forms items off these libraries.
    Regards
    Quintin

  • How to use a structure at run time....

    Hi gurus,
    I am confused on how to use the structure in our report..why do we need it...Please help me with that...
    Thanks
    Cheers:Jim

    Or you could simply use a structure in your program to group like fields together.  So that you could maybe clear them all at one shot.
    For example, say that you have a structure with fields a - z.
    data: begin of structure,
            fielda type c,
            fieldb type c,
            fieldc type c,
            fieldz type c,
            end of structure.
    So in your program, it is now important for you to clear these fields, if you would have defined them one by one without the structure, you would have to list them all in your CLEAR statement, but instead, since you have them in a structure, you can some say....   CLEAR STRUCTURE.
    Regards,
    Rich Heilman

  • How to use event structure of event data nodes event filter nodes in programming

    hi,
    I need manual of how to use 'event structure' events of 'event data nodes' and 'event data filters'...please help me....
    Regards
    Ravindranath

    I'm not really sure what you are looking for here.  Did you do a search in the LabVIEW help for Event Structure?
    The Event Data Node just returns information about the event, like control data, control reference, what caused the event, etc.
    The Event Data Filters are just used in Filter Events.  This allows you to discard an event or change the data that the event will recieve.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to handle Tree structure in bdc

    Hi Experts,
          How to handle Tree structure in bdc, can any one have any idea regarding this.
        In the top most of the tree i  have  :  Occupational Health under that Identification is there .
          Occupational Health
                           Identification
    Regards,
    Sudhakar Reddy.A

    Hi Experts,
    Thanks Parvatha reddy for your reply.
    Can any one provide BAPI for this T.Code EHSQCATOH  or can any one tell me how to handle Tree structure .
    Regards,
    Sudhakar Reddy .A

  • How to develop tree structure using webdynpro

    hi everybody,
    I want to develop a sample tree structure for an object in webdynpro.can u help how to develop that one.

    Hi Srinivas,
    Here are links...
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/47ce9b90-0201-0010-59b5-f70826824eee
    http://help.sap.com/saphelp_nw04/helpdata/en/33/af0abb4559424dad802cbc7e31eaf2/content.htm
    Hope it helps.
    Regards,
    Maheswaran.B
    Message was edited by:
            Maheswaran B

  • How to create tree structure in abap

    hi,
       I am mohan. Please send the how to create the tree structure. how to insert the child nodes in  root node. actually our requirement is we have list transaction codes. We are planning to put all transaction codes in tree level.
    please tell me how to do the program in tree structure.

    Hi Mohan,
    Check the following program on ALV tree.
    REPORT zalvtree.
    CLASS cl_gui_column_tree DEFINITION LOAD.
    CLASS cl_gui_cfw DEFINITION LOAD.
    DATA: go_grid TYPE REF TO cl_gui_alv_grid.
    DATA: ro_grid TYPE REF TO cl_gui_alv_grid.
    DATA tree1  TYPE REF TO cl_gui_alv_tree.
    DATA mr_toolbar TYPE REF TO cl_gui_toolbar.
    DATA : gt_checked TYPE lvc_t_chit,
           gs_checked LIKE LINE OF gt_checked,
           l_part_key TYPE lvc_nkey,
           gt_node TYPE lvc_s_chit-nodekey.
    INCLUDE <icon>.
    INCLUDE zamit_alv_tree_toolbar_event.
    INCLUDE zbcalv_tree_event_receiver.
    *DATA: toolbar_event_receiver TYPE REF TO lcl_toolbar_event_receiver.
    DATA: gt_sflight      TYPE sflight OCCURS 0,      "Output-Table
          gt_fieldcatalog TYPE lvc_t_fcat, "Fieldcatalog
          ok_code LIKE sy-ucomm.           "OK-Code
    START-OF-SELECTION.
    END-OF-SELECTION.
      CALL SCREEN 100.
    *&      Module  PBO  OUTPUT
          process before output
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      IF tree1 IS INITIAL.
        PERFORM init_tree.
    else.
                  CALL METHOD me->refresh_table_display
                    EXCEPTIONS
                      PROGRAM_ERROR = 1
                      others        = 2
                  IF sy-subrc <> 0.
                   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                  ENDIF.
      ENDIF.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                             " PBO  OUTPUT
    *&      Module  PAI  INPUT
          process after input
    MODULE pai INPUT.
      CASE ok_code.
        WHEN 'EXIT' OR 'BACK' OR 'CANC'.
          PERFORM exit_program.
    *mrk
        WHEN 'MOVE'.
          PERFORM check_selection.
        WHEN 'MBAK'.
          PERFORM another_selection.
        WHEN 'ALL'.
          PERFORM select_all.
        WHEN 'CLEAR'.
          PERFORM clear_all.
        WHEN 'DELETE'.
          PERFORM delete_all.
        WHEN 'EXPAND'.
          PERFORM expand_all.
        WHEN 'COLLAPSE'.
          PERFORM collapse_all.
        WHEN OTHERS.
          CALL METHOD cl_gui_cfw=>dispatch.
      ENDCASE.
      CLEAR ok_code.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                             " PAI  INPUT
    *&      Form  build_fieldcatalog
          build fieldcatalog for structure sflight
    FORM build_fieldcatalog.
    get fieldcatalog
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'SFLIGHT'
        CHANGING
          ct_fieldcat      = gt_fieldcatalog.
    change fieldcatalog
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      LOOP AT gt_fieldcatalog INTO ls_fieldcatalog.
        CASE ls_fieldcatalog-fieldname.
          WHEN 'CARRID' OR 'CONNID' OR 'FLDATE'.
            ls_fieldcatalog-no_out = 'X'.
            ls_fieldcatalog-key    = ''.
          WHEN 'PRICE' OR 'SEATSOCC' OR 'SEATSMAX' OR 'PAYMENTSUM'.
            ls_fieldcatalog-do_sum = 'X'.
        ENDCASE.
        MODIFY gt_fieldcatalog FROM ls_fieldcatalog.
      ENDLOOP.
    ENDFORM.                               " build_fieldcatalog
    *&      Form  build_hierarchy_header
          build hierarchy-header-information
         -->P_L_HIERARCHY_HEADER  strucxture for hierarchy-header
    FORM build_hierarchy_header CHANGING
                                   p_hierarchy_header TYPE treev_hhdr.
      p_hierarchy_header-heading = 'Hierarchy Header'.          "#EC NOTEXT
      p_hierarchy_header-tooltip =
                             'This is the Hierarchy Header !'.  "#EC NOTEXT
      p_hierarchy_header-width = 30.
      p_hierarchy_header-width_pix = ''.
    ENDFORM.                               " build_hierarchy_header
    *&      Form  exit_program
          free object and leave program
    FORM exit_program.
      CALL METHOD tree1->free.
      LEAVE PROGRAM.
    ENDFORM.                               " exit_program
    *&      Form  check_selection
          text
    -->  p1        text
    <--  p2        text
    FORM check_selection .
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container2 TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE2'.
      IF sy-batch IS INITIAL.
        CREATE OBJECT l_custom_container2
          EXPORTING
                container_name = l_tree_container_name
          EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc <> 0.
          MESSAGE x208(00) WITH 'ERROR'.                        "#EC NOTEXT
        ENDIF.
      ENDIF.
      CREATE OBJECT go_grid
        EXPORTING
       I_SHELLSTYLE      = 0
       I_LIFETIME        =
          i_parent          = l_custom_container2
       I_APPL_EVENTS     = space
       I_PARENTDBG       =
       I_APPLOGPARENT    =
       I_GRAPHICSPARENT  =
       I_NAME            =
    EXCEPTIONS
       ERROR_CNTL_CREATE = 1
       ERROR_CNTL_INIT   = 2
       ERROR_CNTL_LINK   = 3
       ERROR_DP_CREATE   = 4
       others            = 5
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      PERFORM load_data_into_grid.
    *data: lt_nodes type LVC_T_NKEY,
         ls_nodes like line of lt_nodes,
         ls_checked like line of gt_checked.
    *loop at gt_checked into ls_checked.
    ls_nodes = ls_checked-nodekey.
    append ls_nodes to lt_nodes.
    *endloop.
    *CALL METHOD tree1->unselect_nodes
    EXPORTING
       it_node_key                  = lt_nodes
    EXCEPTIONS
       CNTL_SYSTEM_ERROR            = 1
       DP_ERROR                     = 2
       MULTIPLE_NODE_SELECTION_ONLY = 3
       ERROR_IN_NODE_KEY_TABLE      = 4
       FAILED                       = 5
       others                       = 6
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    ENDFORM.                    " check_selection
    *&      Form  another_selection
          text
    -->  p1        text
    <--  p2        text
    FORM another_selection .
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container2 TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE2'.
      IF sy-batch IS INITIAL.
        CREATE OBJECT l_custom_container2
          EXPORTING
                container_name = l_tree_container_name
          EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc <> 0.
          MESSAGE x208(00) WITH 'ERROR'.                        "#EC NOTEXT
        ENDIF.
      ENDIF.
      CREATE OBJECT ro_grid
        EXPORTING
       I_SHELLSTYLE      = 0
       I_LIFETIME        =
          i_parent          = l_custom_container2
       I_APPL_EVENTS     = space
       I_PARENTDBG       =
       I_APPLOGPARENT    =
       I_GRAPHICSPARENT  =
       I_NAME            =
    EXCEPTIONS
       ERROR_CNTL_CREATE = 1
       ERROR_CNTL_INIT   = 2
       ERROR_CNTL_LINK   = 3
       ERROR_DP_CREATE   = 4
       others            = 5
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      PERFORM load_data_into_grid1.
      DATA: lt_unsel TYPE lvc_t_nkey,
            ls_unsel LIKE LINE OF lt_unsel.
      LOOP AT gt_checked INTO gs_checked.
        ls_unsel = gs_checked-nodekey.
        APPEND ls_unsel TO lt_unsel.
      ENDLOOP.
      CALL METHOD tree1->unselect_nodes
        EXPORTING
          it_node_key                  = lt_unsel
        EXCEPTIONS
          cntl_system_error            = 1
          dp_error                     = 2
          multiple_node_selection_only = 3
          error_in_node_key_table      = 4
          failed                       = 5
          OTHERS                       = 6.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *CALL METHOD tree1->unselect_all
    EXCEPTIONS
       CNTL_SYSTEM_ERROR = 1
       FAILED            = 2
       others            = 3
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
      DATA: text TYPE lvc_value,
       item TYPE lvc_t_layi,
       node TYPE lvc_s_layn,
       inode TYPE lvc_nkey.
      FIELD-SYMBOLS: <wa> TYPE ANY.
      DATA: l_dref_wa LIKE LINE OF gt_sflight.
      ASSIGN l_dref_wa TO <wa>.
      READ TABLE gt_checked INTO gs_checked WITH KEY nodekey = 3.
      inode = gs_checked-nodekey.
      CALL METHOD tree1->get_outtab_line
        EXPORTING
          i_node_key     = inode
        IMPORTING
          e_outtab_line  = <wa>
          e_node_text    = text
          et_item_layout = item
          es_node_layout = node
        EXCEPTIONS
          node_not_found = 1
          OTHERS         = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      DATA: lt_layout TYPE lvc_t_laci,
            layout LIKE LINE OF lt_layout.
      layout-chosen = 'X'.
      layout-fieldname = tree1->c_hierarchy_column_name.
    ls_item_layout-chosen = 'X'.           "To give default checkbox value checked
      layout-class   = cl_gui_column_tree=>item_class_checkbox.
      layout-editable = 'X'.
    LAYOUT-U_CHOSEN = 'X'.
      APPEND layout TO lt_layout.
      CALL METHOD tree1->change_node
        EXPORTING
          i_node_key     = inode
          i_outtab_line  = <wa>
       IS_NODE_LAYOUT =
          it_item_layout =  lt_layout
       I_NODE_TEXT    =
       I_U_NODE_TEXT  =
        EXCEPTIONS
          node_not_found = 1
          OTHERS         = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *CALL METHOD tree1->change_item
    EXPORTING
       i_node_key     = inode
       i_fieldname    = gs_checked-FIELDNAME
       i_data         = <wa>
       I_U_DATA       = ''
       IS_ITEM_LAYOUT = layout
    EXCEPTIONS
       NODE_NOT_FOUND = 1
       others         = 2
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    *loop at lt_unsel into ls_unsel.
    *CALL METHOD tree1->update_checked_items
    EXPORTING
       i_node_key    = ls_unsel
       i_fieldname   = ''
       i_checked     = ''
    EXCEPTIONS
       PROGRAM_ERROR = 1
       others        = 2
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    *endif.
    ENDFORM.                    " another_selection
    *&      Form  select_all
          text
    -->  p1        text
    <--  p2        text
    FORM select_all .
      CONSTANTS: c_x(1) TYPE c VALUE 'X'.
    *********Check box modifications.
      CALL METHOD tree1->delete_all_nodes
        EXCEPTIONS
          failed            = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    clear l_part_key.
    create hierarchy
      PERFORM create_hierarchy USING c_x.
      CALL METHOD tree1->expand_node
        EXPORTING
          i_node_key          = gt_node
       I_LEVEL_COUNT       = 1
          i_expand_subtree    = 'X'
        EXCEPTIONS
          failed              = 1
          illegal_level_count = 2
          cntl_system_error   = 3
          node_not_found      = 4
          cannot_expand_leaf  = 5
          OTHERS              = 6
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    add own functioncodes to the toolbar
    perform change_toolbar.
    register events
    perform register_events.
    adjust column_width
    call method tree1->COLUMN_OPTIMIZE.
    ENDFORM.                    " select_all
    *&      Form  clear_all
          text
    -->  p1        text
    <--  p2        text
    FORM clear_all .
      CONSTANTS: c_x(1) TYPE c VALUE space.
    *********Check box modifications.
      CALL METHOD tree1->delete_all_nodes
        EXCEPTIONS
          failed            = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    create hierarchy
      PERFORM create_hierarchy USING c_x.
      CALL METHOD tree1->expand_node
        EXPORTING
          i_node_key          = gt_node
       I_LEVEL_COUNT       = 1
          i_expand_subtree    = 'X'
        EXCEPTIONS
          failed              = 1
          illegal_level_count = 2
          cntl_system_error   = 3
          node_not_found      = 4
          cannot_expand_leaf  = 5
          OTHERS              = 6
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " clear_all
    *&      Form  delete_all
          text
    -->  p1        text
    <--  p2        text
    FORM delete_all .
    *********Check box modifications.
      CALL METHOD tree1->delete_all_nodes
        EXCEPTIONS
          failed            = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " delete_all
    *&      Form  expand_all
          text
    -->  p1        text
    <--  p2        text
    FORM expand_all .
      CALL METHOD tree1->expand_node
        EXPORTING
          i_node_key          = gt_node
       I_LEVEL_COUNT       = 1
          i_expand_subtree    = 'X'
        EXCEPTIONS
          failed              = 1
          illegal_level_count = 2
          cntl_system_error   = 3
          node_not_found      = 4
          cannot_expand_leaf  = 5
          OTHERS              = 6
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " expand_all
    *&      Form  collapse_all
          text
    -->  p1        text
    <--  p2        text
    FORM collapse_all .
      CALL METHOD tree1->collapse_all_nodes
        EXCEPTIONS
          failed            = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " collapse_all
    *&      Form  load_data_into_grid
          text
    -->  p1        text
    <--  p2        text
    FORM load_data_into_grid .
      DATA:
      For parameter IS_VARIANT
          l_layout TYPE disvariant,
      gs_layout TYPE lvc_s_layo.
      DATA gi_sflight TYPE TABLE OF zsflight.
    Load data into the grid and display them
      l_layout-report = sy-repid.
      gs_layout-grid_title = 'Amits Test Program'.
      gs_layout-sel_mode = 'A'.
      SELECT *
       FROM zsflight
       INTO TABLE gi_sflight.
      CALL METHOD go_grid->set_table_for_first_display
        EXPORTING
          i_structure_name = 'SFLIGHT'
          is_layout        = gs_layout
          is_variant       = l_layout
          i_save           = 'A'
        CHANGING
          it_outtab        = gi_sflight.
    ENDFORM.                    " load_data_into_grid
    *&      Form  load_data_into_grid
          text
    -->  p1        text
    <--  p2        text
    FORM load_data_into_grid1.
      DATA:
      For parameter IS_VARIANT
          l_layout TYPE disvariant,
      gs_layout TYPE lvc_s_layo.
      DATA gi_sflight TYPE TABLE OF zapempl.
    Load data into the grid and display them
      l_layout-report = sy-repid.
      gs_layout-grid_title = 'Rams Test Program'.
      gs_layout-sel_mode = 'A'.
      SELECT *
       FROM zapempl
       INTO TABLE gi_sflight.
      CALL METHOD ro_grid->set_table_for_first_display
        EXPORTING
          i_structure_name = 'ZAPEMPL'
          is_layout        = gs_layout
          is_variant       = l_layout
          i_save           = 'A'
        CHANGING
          it_outtab        = gi_sflight.
    ENDFORM.                    " load_data_into_grid1
    *&      Form  build_header
          build table for html_header
    -->  p1        text
    <--  p2        text
    FORM build_comment USING
          pt_list_commentary TYPE slis_t_listheader
          p_logo             TYPE sdydo_value.
      DATA: ls_line TYPE slis_listheader.
    LIST HEADING LINE: TYPE H
      CLEAR ls_line.
      ls_line-typ  = 'H'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'ALV-tree-demo: flight-overview'.          "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
    STATUS LINE: TYPE S
      CLEAR ls_line.
      ls_line-typ  = 'S'.
      ls_line-key  = 'valid until'.                             "#EC NOTEXT
      ls_line-info = 'January 29 1999'.                         "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
      ls_line-key  = 'time'.
      ls_line-info = '2.00 pm'.                                 "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
    ACTION LINE: TYPE A
      CLEAR ls_line.
      ls_line-typ  = 'A'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'actual data'.                             "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
      p_logo = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "build_comment
    *&      Form  create_hierarchy
          text
    -->  p1        text
    <--  p2        text
    FORM create_hierarchy USING p_x.
      DATA: ls_sflight TYPE sflight,
            lt_sflight TYPE sflight OCCURS 0.
    get data
      SELECT * FROM sflight INTO TABLE lt_sflight
                            UP TO 200 ROWS .
      SORT lt_sflight BY carrid connid fldate.
    add data to tree
      DATA: l_carrid_key TYPE lvc_nkey,
            l_connid_key TYPE lvc_nkey,
            l_last_key TYPE lvc_nkey.
           l_part_key TYPE lvc_nkey
      PERFORM add_carrid_line USING    ls_sflight
                              CHANGING l_part_key.
      gt_node = l_part_key.
      LOOP AT lt_sflight INTO ls_sflight.
        ON CHANGE OF ls_sflight-carrid.
          PERFORM add_carrid_line USING    ls_sflight
                                           l_part_key
                                  CHANGING l_carrid_key.
          PERFORM add_connid_line USING    ls_sflight
                                           l_carrid_key
                                  CHANGING l_connid_key.
          PERFORM add_complete_line USING  ls_sflight
                                         l_connid_key
                                         p_x
                                CHANGING l_last_key.
          CONTINUE.
        ENDON.
        ON CHANGE OF ls_sflight-connid.
          PERFORM add_connid_line USING    ls_sflight
                                           l_carrid_key
                                  CHANGING l_connid_key.
          PERFORM add_complete_line USING  ls_sflight
                                         l_connid_key
                                         p_x
                                CHANGING l_last_key.
          CONTINUE.
        ENDON.
        PERFORM add_complete_line USING  ls_sflight
                                         l_connid_key
                                         p_x
                                CHANGING l_last_key.
      ENDLOOP.
    calculate totals
      CALL METHOD tree1->update_calculations.
    this method must be called to send the data to the frontend
      CALL METHOD tree1->frontend_update.
    ENDFORM.                               " create_hierarchy
    *&      Form  add_carrid_line
          add hierarchy-level 1 to tree
         -->P_LS_SFLIGHT  sflight
         -->P_RELEATKEY   relatkey
        <-->p_node_key    new node-key
    FORM add_carrid_line USING     ps_sflight TYPE sflight
                                   p_relat_key TYPE lvc_nkey
                         CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_sflight TYPE sflight.
    set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@3P@'.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
      APPEND ls_item_layout TO lt_item_layout.
    add node
      l_node_text =  ps_sflight-carrid.
      CALL METHOD tree1->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_sflight
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = p_node_key.
    ENDFORM.                               " add_carrid_line
    *&      Form  add_connid_line
          add hierarchy-level 2 to tree
         -->P_LS_SFLIGHT  sflight
         -->P_RELEATKEY   relatkey
        <-->p_node_key    new node-key
    FORM add_connid_line USING     ps_sflight TYPE sflight
                                   p_relat_key TYPE lvc_nkey
                         CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_sflight TYPE sflight.
    set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@3Y@'.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensified.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      APPEND ls_item_layout TO lt_item_layout.
    add node
      l_node_text =  ps_sflight-connid.
      CALL METHOD tree1->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_sflight
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = p_node_key.
    ENDFORM.                               " add_connid_line
    *&      Form  add_cmplete_line
          add hierarchy-level 3 to tree
         -->P_LS_SFLIGHT  sflight
         -->P_RELEATKEY   relatkey
        <-->p_node_key    new node-key
    FORM add_complete_line USING   ps_sflight TYPE sflight
                                   p_relat_key TYPE lvc_nkey
                                   p_x
                         CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value.
    set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      ls_item_layout-chosen = p_x.           "To give default checkbox value checked
      ls_item_layout-class   = cl_gui_column_tree=>item_class_checkbox.
      ls_item_layout-editable = 'X'.
      APPEND ls_item_layout TO lt_item_layout.
      l_node_text =  ps_sflight-fldate.
      CALL METHOD tree1->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          is_outtab_line   = ps_sflight
          i_node_text      = l_node_text
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = p_node_key.
    ENDFORM.                               " add_complete_line
    *&      Form  register_events
          text
    -->  p1        text
    <--  p2        text
    FORM register_events.
    define the events which will be passed to the backend
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event.
    define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_click.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
      APPEND l_event TO lt_events.
      CALL METHOD tree1->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    set Handler
      DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
      CREATE OBJECT l_event_receiver.
      SET HANDLER l_event_receiver->handle_node_ctmenu_request
                                                            FOR tree1.
      SET HANDLER l_event_receiver->handle_node_ctmenu_selected
                                                            FOR tree1.
      SET HANDLER l_event_receiver->handle_item_ctmenu_request
                                                            FOR tree1.
      SET HANDLER l_event_receiver->handle_item_ctmenu_selected
                                                            FOR tree1.
      SET HANDLER l_event_receiver->handle_checkbox_change FOR tree1.
    ENDFORM.                               " register_events
    *&      Form  change_toolbar
          text
    -->  p1        text
    <--  p2        text
    FORM change_toolbar.
    DATA: toolbar_event_receiver TYPE REF TO lcl_toolbar_event_receiver.
    get toolbar control
      CALL METHOD tree1->get_toolbar_object
        IMPORTING
          er_toolbar = mr_toolbar.
      CHECK NOT mr_toolbar IS INITIAL.
    add seperator to toolbar
      CALL METHOD mr_toolbar->add_button
        EXPORTING
          fcode     = ''
          icon      = ''
          butn_type = cntb_btype_sep
          text      = ''
          quickinfo = 'This is a Seperator'.                    "#EC NOTEXT
    add Standard Button to toolbar (for Delete Subtree)
      CALL METHOD mr_toolbar->add_button
        EXPORTING
          fcode     = 'DELETE'
          icon      = '@18@'
          butn_type = cntb_btype_button
          text      = ''
          quickinfo = 'Delete subtree'.                         "#EC NOTEXT
    add Dropdown Button to toolbar (for Insert Line)
      CALL METHOD mr_toolbar->add_button
        EXPORTING
          fcode     = 'INSERT_LC'
          icon      = '@17@'
          butn_type = cntb_btype_dropdown
          text      = ''
          quickinfo = 'Insert Line'.                            "#EC NOTEXT
    set event-handler for toolbar-control
      CREATE OBJECT toolbar_event_receiver.
      SET HANDLER toolbar_event_receiver->on_function_selected
                                                          FOR mr_toolbar.
      SET HANDLER toolbar_event_receiver->on_toolbar_dropdown
                                                          FOR mr_toolbar.
    ENDFORM.                               " change_toolbar
    *&      Form  init_tree
          text
    -->  p1        text
    <--  p2        text
    FORM init_tree.
    create fieldcatalog for structure sflight
      PERFORM build_fieldcatalog.
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE1'.
      IF sy-batch IS INITIAL.
        CREATE OBJECT l_custom_container
          EXPORTING
                container_name = l_tree_container_name
          EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc <> 0.
          MESSAGE x208(00) WITH 'ERROR'.                        "#EC NOTEXT
        ENDIF.
      ENDIF.
    create tree control
      CREATE OBJECT tree1
        EXPORTING
            parent              = l_custom_container
            node_selection_mode = cl_gui_column_tree=>node_sel_mode_multiple "node_sel_mode_single
            item_selection      = 'X'
            no_html_header      = ''
            no_toolbar          = ''
        EXCEPTIONS
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    create Hierarchy-header
      DATA l_hierarchy_header TYPE treev_hhdr.
      PERFORM build_hierarchy_header CHANGING l_hierarchy_header.
    create info-table for html-header
      DATA: lt_list_commentary TYPE slis_t_listheader,
            l_logo             TYPE sdydo_value.
      PERFORM build_comment USING
                     lt_list_commentary
                     l_logo.
    repid for saving variants
      DATA: ls_variant TYPE disvariant.
      ls_variant-report = sy-repid.
    create emty tree-control
      CALL METHOD tree1->set_table_for_first_display
        EXPORTING
          is_hierarchy_header = l_hierarchy_header
          it_list_commentary  = lt_list_commentary
          i_logo              = l_logo
          i_background_id     = 'ALV_BACKGROUND'
          i_save              = 'A'
          is_variant          = ls_variant
        CHANGING
          it_outtab           = gt_sflight "table must be emty !!
          it_fieldcatalog     = gt_fieldcatalog.
      CONSTANTS: c_s(1) TYPE c VALUE space.
    create hierarchy
      PERFORM create_hierarchy USING c_s.
    add own functioncodes to the toolbar
      PERFORM change_toolbar.
    register events
      PERFORM register_events.
    adjust column_width
    call method tree1->COLUMN_OPTIMIZE.
    ENDFORM.                    " init_tree
    Award points if found useful.
    Regards
    Indrajit

  • How to get Tree structure in JSP page?

    Hi,
    I would like get data from the database and display the data in tree structure with the check boxes at each nodes on a jsp page with out using any third party tools. how can i do that? Do i require any new tags to fulfill this requirement?
    can any one help me out by sending any example code?
    thanks in advance.
    Regards,
    Reddy

    Once you have the data in a list or something, can't you just use <c:forEach> and then output standard nested <ul> and <li> tags to give the tree structure.
    <html>
         <style>
              li
                   list-style-type:none;
         </style>
         <body>
              <form>
                   <ul>
                        <li>
                             <input type="checkbox">Check 1</input>
                             <ul>
                                  <li>
                                       <input type="checkbox">Check 1A</input>
                                  </li>
                                  <li>
                                       <input type="checkbox">Check 1B</input>
                                  </li>
                             </ul>
                        </li>
                        <li>
                             <input type="checkbox">Check 2</input>
                             <ul>
                                  <li>
                                       <input type="checkbox">Check 2A</input>
                                  </li>
                             </ul>
                        </li>
                        <li>
                             <input type="checkbox">Check 3</input>
                        </li>
                   </ul>
              </form>
         </body>
    </html>

  • Tutorial Announcement :: How To Use Auto Complete Text Form Control ::

    Hello Everyone...
    Here in this tutorial we gonna to learn a new and amazing feature of (ADDT), we will learn how to use Adobe developer toolbox (ADDT) form controls.
    Form controls help you to add a fantastic features to your forms, that helps you to expand the form abilities and functionality...
    The Auto complete Text Field is an enhanced text field that dynamically completes what you type with matched values from a table. You can also select the values from a list.
    You can use the Auto complete Text Field in user registration forms, such as allowing users to select their country or city easier, Also in other forms that needs the user to pick one of many choices without any difficulties.
    Requirements
    To complete this tutorial you will need to install the following software and files:
    Adobe Dreamweaver Cs3
    Adobe Developer Toolbox (ADDT)
    Don't forget: to try out the Demo type the first three letters :A - B - C
    :: Go To Tutorials ::
    :: Go To Tutorials ::
    Best Regards
    Waleed Barakat
    Developer-Online Creator and programmer
    http://www.developer-online.com

    Heya Waleed,
    I use spry to create an autocomplete form that works great across browsers that have javascript enabled. You can store info in a database and parse the info to xml for a dynamic approach. Take a look at the filter examples in spry.
    http://labs.adobe.com/technologies/spry/samples/data_region/NonDestructiveFilterSample.htm l
    http://labs.adobe.com/technologies/spry/samples/data_region/ZuggestSample.html

  • How to use tree tables with CRUD operation for begineers ADF 11g

    This is Friday night call for help.
    This is only few sample ressources on the web for tree table and only one with CRUD operation.
    I used this one http://jobinesh.blogspot.com/2010/05/crud-operations-on-tree-table.html because this is the only one that address CRUD.
    And it is shaky. Deletion works fine but insertion not very well. This is working using custom code provided below.
    Depending if the user selection in the tree, the code insert from the master node to the children node.
    Any other options because it is not working well.
    Also where Oracle describes how to use the row, rowset, itorator API? This is really hard to understand like almost if we should not use it.
    then if not how can I insert in tree with two nodes and insert in the parent or children depending the users selection.
    Lately I 'been posting questions on this forum with no response. This hurts. I understand developers cannot spend their time on this but People from Oracle, please help. We pay licenses...
    public void createChildren(RowIterator ri, Key selectedNodeKey) {
    final String deptViewDefName = "model.DepartmentsView";
    final String empViewDefName = "model.EmployeesView";
    if (ri != null && selectedNodeKey != null) {
    Row last = ri.last();
    Key lastRowKey = last.getKey();
    // if the select row is not the last row in the row iterator...
    Row[] found = ri.findByKey(selectedNodeKey, 1);
    if (found != null && found.length == 1) {
    Row foundRow = found[0];
    String nodeDefname =
    foundRow.getStructureDef().getDefFullName();
    if (nodeDefname.equals(deptViewDefName)) {
    RowSet parents =
    (RowSet)foundRow.getAttribute("EmployeesView");
    Row childrow = parents.createRow();
    parents.insertRow(childrow);
    } else {
    RowSet parents =
    (RowSet)foundRow.getAttribute("EmployeesView");
    Row childrow = parents.createRow();
    childrow.setAttribute("DepartmentId",
    foundRow.getAttribute("DepartmentId"));
    parents.insertRow(childrow);
    } else {
    System.out.println("Node not Found for " + selectedNodeKey);
    }

    I am looking for a sample that describe how to design a jsf page with a tree table.
    So you have Department and employees. In the tree first comes Department and if you click the node you see the employees assigned to this department.
    I need to be able to insert a new department or a new employee from the tree table by clicking on a insert button in the panel collection toolbar depending on user selection in the tree.
    I got part of it working but not good enough.
    By problem is the get insertion working
    I have a createChildren method in my AM implementation that get in input a RowIterator and selected node key.
    To goal is to create new records depending of the user selection and the input parameters get populated by the binding like this:
    #{backing_treeSampleBean.selectedNodeRowIterator} #{backing_TreeSampleBean.selectedNodeRowkey} via method binding with parameters.
    Is it the right approach?
    First to be able to insert a parent record, I select nothing in the tree and ri and selectedNodeKey comes to null
    we run this code
    ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
    //ViewObjectImpl vo = getDepartmentsView1();
    Row foundRow = vo.first();
    Row childrow = vo.createRow();
    vo.insertRow(childrow);
    A new blank entry appears in the parent node and we enter a value.
    The the problem starts when we want to add a child to this parent.
    We select the created parent and press the insert button, this code get executed
    if (nodeDefname.equals(deptViewDefName))
    //list of the children of the parent and create an new row
    RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
    Row childrow = childRows.createRow();
    childRows.insertRow(childrow);
    But the new entry does not appear, it is almost like it would be created for a different parent because this is a mandatory field that is not feel in yet and the interface complaints of a missing value. It is created somewhere just not a the right place... This is my guess.
    Do you see something wrong with the code?
    The full code og my create children method is there below
    I am using jdeveloper 11.1.1.3.0 any issues with tree table to know about with this version?
    Thanks for your help
    public void createChildren(RowIterator ri, Key selectedNodeKey) {
    final String deptViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidaySchedExceptionsView";
    final String empViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidayExceptionDatesView";
    if (ri != null && selectedNodeKey != null) {
    // last row
    Row last = ri.last();
    Key lastRowKey = last.getKey();
    // if the select row is not the last row in the row iterator...
    Row[] found = ri.findByKey(selectedNodeKey, 1);
    if (found != null && found.length == 1) {
    // foundRow is the row selected
    Row foundRow = found[0];
    // The row selected can be the parent node or the child node
    String nodeDefname = foundRow.getStructureDef().getDefFullName();
    // if parent row
    if (nodeDefname.equals(deptViewDefName))
    //list of the children of the parent and create an new row
    //works but we try to resolve the creation of a parent
    RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
    Row childrow = childRows.createRow();
    //childrow.setAttribute("HolidayDate", new java.util.Date().getDate());
    System.out.println("insert child row from master");
    childRows.insertRow(childrow);
    } else
    //RowSet ParentRow = (RowSet)foundRow.getAttribute("SchHolidaySchedExceptionsView");
    //RowSet childRows = (RowSet)ParentRow.first().getAttribute("SchHolidayExceptionDatesView");
    Row childrow = ri.createRow();
    System.out.println("insert child row from child ");
    } else {
    System.out.println("Node not Found for " + selectedNodeKey);
    } else {
    System.out.println(" param null try creating for first row : " +
    ri + " * " + selectedNodeKey);
    ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
    Row foundRow = vo.first();
    Row childrow = vo.createRow();
    vo.insertRow(childrow);
    }

Maybe you are looking for