TreeByNestingTableColumn - how to set lead selection?

Hallo Guys!
I am using TreeByNestingTableColumn in my project. I am searching for a way to select a certain context element inside of the tree shown in such a table. I actually know that setLeadSelection doesn’t work properly in such a case.
I’ve already read this very helpful blog /people/valery.silaev/blog/2005/06/20/master-of-columns-part-ii searching for a solution, but its seemed not to be there.
Valery had shown how to read the selected context element recursively, but there is nothing about to how to set the needed lead selection for a certain one.
In my scenario, I am loading the whole table (10-15 elements) with only two levels of hierarchy. After the user clicks on a button I have to reload this table but keep the selection of the previously selected element.
The try using getTreeSelection didn’t succeed either.
Any ideas?
Many Thanks
Dimitri
Edited by: Dmytro Lubenskyy on Apr 1, 2008 3:44 PM

Hi,
You can use the following methods to set the selection.
IWDNodeElement nodeElement = wdContext.nodeOrders().getElementAt(2);
       wdContext.nodeOrders().setTreeSelection(nodeElement);
Regards
Ayyapparaj

Similar Messages

  • How to set default selection in html:radio

    hai
    how to set default selection in <html:radio>.

    No it won't help.
    You can't set a value into an <input type="file"> control at all. The user has to put values in themselves.
    The reason behind this is security. If the programmer could put any value they liked in there, you could upload any file at all from a users computer without their intervention. eg C:\windows\system32\passwords.txt
    Bottom line: you can't put a default value into the input type="file" control.
    And a good thing too ;-)

  • How to set default selected checkbox in af:tableSelectMany /

    Hi,
    I am new to ADF technology, I am using JDev 10..3g.
    I want to set the checkbox as default selected for particular rows.
    but I don't know how to set default selected checkbox in <af:tableSelectMany />
    Is there any way to do this using ADF<af:tableSelectMany />
    Thanks,
    Mohammed

    Hi Jeroen,
    Thanks for reply. but the problem is that I am getting data from database and based on some flag I need to select checkbox while page is loading first time.
    at that time the table is null as till now it not rendered. and when its rendered it means page is displayed now.
    just before display I need to set checkbox as selected.
    I don't want to do like this (when user is pressing any command button then only is should update checkbox selection).
    Thanks,
    Mohammed.

  • How to set up selected ringtone in i-phone 5...?

    hi, please help
    how to set up selected ringtone in i-phone 5...?

    i mean if i want to select my own song from i-tune and want to set it as a ringtone...then how is it done..?

  • How to do lead select and double click on a row of table simultaniously ?

    Hello All,
    I am creating a freely programmed search help to search Material Number.
    i am displaying the values in normal table ( Not ALV ) on the search help popup.
    My requirement is
    when I select a row and click on OK button the Material number in that row is getting captured ( This is working fine for me)
    At the same time I also want to capture the value when user double cluck on the particular row.
    I am not able to do both on action methods simultaneously as I am getting syntactic error.
    i.e. When I create action method on the event "on_lead_select" and the event "On select"  and try to save Check & activate it throws error.
    Please find the screen shot below.
    Standard webdynpro component WDR_F4_ELEMENTARY was able to achieve this functionality some how, I have debugged it but didn't get the solution

    Hi,
    There is no double click provision. In the table you could change the cell editor of column to LinktoAction UI, then onclick of that you can set the selected value.  And in the component WDR_F4_ELEMENTARY its not a normal table UI but its a CTable UI, you can try creating a CTable and create an Action for onSelect.
    Regards,
    Kiran

  • How to set default selection in tableSelectOne

    Hi Friends,
    How to set tableSelectOne through backing bean.
    I am opening a child window which will populate the list in table format. I am loading it through manually. Now i want to set the first record to be selected. Kindly let me know how to do it.
    The below is my code in jspx
    <af:table emptyText="#{mofRes['mofEgov.po.noItemsFound']}" rows="5" banding="row"
    bandingInterval="1" binding="#{BeneficiaryTableHandler.beneficiaryTable}"
    value="#{BeneficiaryTableHandler.beneficiaryTableModel}" var="rowBeneficiary"
    id="table2" width="900">
    <f:facet name="selection">
    <af:tableSelectOne binding="#{BeneficiaryTableHandler.beneficiarySelectOne}"
    id="tableSelectOne"/>
    </f:facet>
    <af:column sortable="false" sortProperty="bankName"
    headerText="#{mofRes['mofEgov.supplier.bankName']}"
    binding="#{BeneficiaryTableHandler.beneficiaryColumn3}"
    id="beneficiaryColumn3" formatType="icon">
    <af:outputText value="#{rowBeneficiary.bankName}"
    id="beneficiaryOutputText3"
    binding="#{backing_apps_po_POBeneficiaryOutput.beneficiaryOutputText3}"/>
    </af:column>
    <af:column sortable="false" sortProperty="bankActName"
    headerText="#{mofRes['mofEgov.supplier.bankActName']}"
    binding="#{BeneficiaryTableHandler.beneficiaryColumn1}"
    id="beneficiaryColumn1" formatType="icon"
    gridVisible="true">
    <af:outputText value="#{rowBeneficiary.bankActName}"
    id="beneficiaryOutputText1"
    binding="#{backing_apps_po_POBeneficiaryOutput.beneficiaryOutputText1}"/>
    </af:column>
    </af:table>
    Below code used in backing bean to create rows in the table
    for (int rwIndx = 0; rwIndx < siteLiseSize ; ++rwIndx) {
    beneficiaryBean = (BeneficiaryBean)beneficiaryList.get(rwIndx);
    handler.createRow(beneficiaryBean);
    logger.log(Level.INFO," --- Bank Name --- :"+beneficiaryBean.getBankActName()+": --- Bank Act No -- :"+beneficiaryBean.getBankActNo());
    public void createRow(BeneficiaryBean bean) {
    //logger.log(Level.FINE," ---- createRow Start --- ");
    ((Collection)beneficiaryTableModel.getWrappedData()).add(bean);
    //logger.log(Level.FINE," ---- createRow End --- ");
    Thanks & Regards
    VB

    This is probably too late to help, but I had a similar situation. There are a couple of ways to solve this.
    1. Set the ID values on the af:form, af:table, and af:tableSelectOne tags, and write some javascript code to select the first radio button, in the event there are no radio buttons selected. Something like this would work.
              function selectFirstRadio() {
                radioButtons = document.myform['mytable:myradios'];
                anypressed = false;
                for (i = 0; i < radioButtons.length; i++) {
                  radioButton = radioButtons;
    if (anypressed.checked) {
    anypressed = true;
    if (!anypressed) {
    document.myform['mytable:myradios'][0].checked = true;
    This would have an af:form with an id='myform', an af:table with an id='mytable', and an af:tableSelectOne with an id='myradios'
    The other method I used was, in the accessor for getting the value for the af:table was this:
        public DataModel getMyModel() {
            RowKeySet selectedItem = myTable.getSelectionState();
            if ((selectedItem == null) || (selectedItem.getSize() == 0)) {
                Object o = myModel.getWrappedData();
                List rows = (List)myModel.getWrappedData();
                try {
                    selectedItem.getKeySet().add( "0" );
                } catch (Throwable t) {
                    t.printStackTrace();
            return myModel;
        }'myTable' is a binding from an af:table to a UIXTable.
    I should add, this is for ADF 10.1.3.x, not ADF 11.
    Best of luck.
    Edited by: daiken on Mar 27, 2009 7:13 AM

  • How to display lead selection ONLY in the ALV

    HI All,
       User would like display the selected records in ALV . 
       i suggested that add two button - "Display ALL" & "Display Selected" .
       How can i only display the lead selection only in the ALV? or Hide un-selected records.
       Please help.
    Thank you so much
    Gordon

    Hi,
    Pelase have a look.. same requirement.
    get_selected_elements method for ALV
    Re: select rows in alv and show them in another alv in another view
    Web dynpro ALV table copy selected row
    cheers,
    Kris.

  • How to remove lead selection in table dynamically

    I have a table in webdynpro which allows multiple selections of row. I have a button which is supposed to be clicked after selecting single or multiple rows. After clicking on the button I want to remove the lead selection of the  selected rows (which is shown in golden color for each selected row) .
    I tried REMOVE_SELECTED ELEMENTS and it works fine but only if i select the row by pressing CTRL. If i had selected a single row by just a mouse click (without ctrl) then it wont work.
    THANKS

    Hallo Amber,
    If_wd_context_node has static attribute no_selection. use that to clear the lead_selection_index.
    node->set-lead_selection_index(  if_wd_context_node=>no_selection ).

  • How to write lead selection method for a  tree by nesting table column

    Hi,
    I have implemented a table with TreeByNestingTableColumn(To show the tree structure in the table).I am not able to get the selected row element in lead selection method.(I am able to get parent element.) .
    could anyone please tell me about this code?
    BR,
    Ashish

    Hi,
    Follow the below steps to the solution for your problem
    1. Create Action "LeadSelection" in View with parameter (name : 'seletedItem'
    and type : I<your node>Element
    2. Bind this action to Table property "onLeadSelec"
    3. In wdModify()
         IWDTable table = (IWDTable) view.getElement("Your table id");
         table.mappingOfOnLeadSelect().addSourceMapping("nodeElement", "selectedEle");
    4. In onActionLeadSelection()
         wdComponentAPI.getMessageManager().reportSuccess("Selected Item : "+selectedEle.get<Your Node Attribute>());
    Let me know if you need more clarification
    Thanks

  • How to set the Selected row and Column in JTable

    Hi,
    i have a problem like the JTable having one Method getSelectedRow() and getSelectedColumn to know the Selected row and Column but if i want to explicitly set the Selected Row and Column,then there is no such type of Methods.If anybody has any solution then i will be thankful to him/her.
    Praveen K Saxena

    Is that what you're looking for? :myTable.getSelectionModel().setSelectionInterval(row, row);
    myTable.getColumnModel().getSelectionModel().setSelectionInterval(column, column);

  • How to block lead selection change in a tree ?

    Hi Guys,
    <u>Scenario</u>
    I have MasterTree - DetailEditor pair. <i>MasterTree</i> is used to visit some tree-structured data and <i>DetailEditor</i> is used to edit currently selected tree node.
    <u>Requirement</u>
    If currently selected node data is updated through <i>DetailEditor</i> and needs to be saved, than on a subsequent tree selection change the user should be warned about unsaved data.
    <u>Implementation</u>
    In <b>onAction</b> event handler of <i>MasterTree</i> I check whether last selected node data is updated and needs to be saved and if this is the case rollback <i>treeSelection</i> to that node. On the time <b>onAction</b> event handler is called the tree selection is changed from the node that needs save to the newly selected node. In order to rollback <i>treeSelection</i> I need to introduce variable referencing last selected tree node.
    <u>Question</u>
    Is there any other technique to implement above scenario without using additional variable and manually rollback <i>treeSelection</i> ? For example, to plug in WDP framework on validation step just before lead selection is changed.
    Thanks in advance

    Alex,
    Here is a link to the phase model of WD:
    http://help.sap.com/saphelp_nw04/helpdata/en/b8/cd96edb9c8794aa362e6e8b4236a1f/frameset.htm
    There aren't any hooks provided prior to the event handlers being called. As far as I can tell, the way you are handling it is the only way that will work.
    -Cindy

  • How to set multi select by script to a list box.

    Hi All,
    I have a list box with multiple select on the form with list (Say A,B,C,D,E,F,G ..)
    When I select A,C,E ans say this.RawValue I get A,C,E separated by carrage returns.
    When i submit the form in my Fm I get A#C#E its all fine.
    Now when the form is openend for the 2nd time to update values I get the value as A,C,E separated by carrage return thats fine too.
    Now i need to set these 3 values as selected by default so i had some java script in form ready.
    Where i iterate tru these list match the entries in the dropdown its fine untill here.
    this.setItemState(index,true)
    is the code to set them as selected but when i do only the 1st found is set to selected not the remaining ones.
    Am i doing something wrong here, please let me know with your suggestions.
    below is my script.
    var ddValue =  this.rawValue;
    ddValue = ddValue.replace("#","\n");
    var ddArray = ddValue.split("\n");
    var ddLen = ddArray.length;
    var textValue = "";
    GM_INTAKE_STRUCTURE.sf80.sfItemBuilder.sfHeaderConditions.dlExpenseType.clearItems;
    GM_INTAKE_STRUCTURE.sf80.sfRequestSummary.dlItem.clearItems;
    for(var i = 0;i<ddLen;i++){
         for(var j = 0;j<this.length;j++){
              if(this.getSaveItem(j) == ddArray<i>){
                   this.setItemState(j,true);                
                   GM_INTAKE_STRUCTURE.sf80.sfItemBuilder.sfHeaderConditions.dlExpenseType.addItem(this.items.nodes.item(j).value,this.getSaveItem(j));
    Thanks & Regards,
    Sai

    Hi Sai,
         The replace function is only replacing the first occur of #, not all of them. But you don't even need to replace the # before you do the split, just change your first lines to split directly with the # character. Your code should look as follow:
    var ddValue =  this.rawValue;
    var ddArray = ddValue.split("#");
    var ddLen = ddArray.length;
    var textValue = "";
    GM_INTAKE_STRUCTURE.sf80.sfItemBuilder.sfHeaderConditions.dlExpenseType.clearItems;
    GM_INTAKE_STRUCTURE.sf80.sfRequestSummary.dlItem.clearItems;
    for(var i = 0;i<ddLen;i++){
         for(var j = 0;j<this.length;j++){
              if(this.getSaveItem(j) == ddArray<i>){
                   this.setItemState(j,true);                
    GM_INTAKE_STRUCTURE.sf80.sfItemBuilder.sfHeaderConditions.dlExpenseType.addItem(this.items.nodes.item(j).value,this.getSaveItem(j));
    Best regards, Aldo.
    Any comments and feedback are welcome.

  • How to set a select option's item as invisible (using a method code)

    Hi there,
    I need to hide parameters and select option fields, but Iu2019m using the select_option component to add all items to the layout using just one View Container Element.
    I could use to hide the View Container Element setting the property visible, but I need to hide fields with certain conditions. I also could add one View Container Element for each select option, but I have many... I wish I could make in other way.
    Iu2019ve checked the Definitions of the Interface IF_WD_SELECT_OPTIONS  and the Ulli Hoffmannu2019s book and I have found no help at all.
    Thanks in advance,
    Filipe Torres
    Edited by: Filipe Torres on Sep 15, 2008 12:34 AM

    Thank you, this helps but will solve just part of my problem. I'm using many views and to pass the values from those select options and parameters I just declare them in the first view... The other answer helps me more that shows how to remove one element. I was looking for a hide feature and not remove, but seems that I have to remove.

  • How to set a selected checkbox in output internal table of oops ALV grid

    Hi All,
    i have a checkbox as first column in my ALV grid output using oops alv, when i select some checkbox, that rows have to be selected and i need to process only selected rows in user command.
    i have given the below code also in fieldcatolg.
    f_fldcat-fieldname = 'checkbox'.
    f_fldcat-tabname ='gi_output'
    f_fldcat-checkbox = 'X'.
    f_fldcat-edit = 'X'.
    but the checkbox is not getting set in internal table when i select some checkboxes.
    can anybody explain y the checkbox in internal table not getting set?
    Thanks,
    Srilakshmi.

    Hi,
    i tried already whatever u said, but still not resolved.Pasted my code below..can u please look into it.
    MODULE pbo OUTPUT.
      PERFORM init_container.
      PERFORM prepare_field_catalog.
      PERFORM prepare_layout.
      PERFORM display_output.
    ENDMODULE.                 " PBO  OUTPUT
    *&      Module  PAI  INPUT
          text
    MODULE pai INPUT.
       DATA: lt_rows TYPE lvc_t_row.
      CASE gv_okcode.
        WHEN gc_exit OR gc_back OR gc_canc. " Finish program
          LEAVE PROGRAM.
          when 'PRINT'.
           CALL METHOD gv_grid->get_selected_rows
                     IMPORTING et_index_rows = lt_rows.
            CALL METHOD cl_gui_cfw=>flush.
      ENDCASE.
    ENDMODULE.                 " PAI  INPUT
    *&      Form  INIT_CONTAINER
          text
    FORM init_container .
      CREATE OBJECT gv_custom_container
        EXPORTING
          container_name = gc_container.
      CREATE OBJECT gv_grid
        EXPORTING
          i_parent = gv_custom_container.
      CREATE OBJECT gv_document
        EXPORTING
          style = 'ALV_GRID'.
    *&      Form  PREPARE_FIELD_CATALOG
          text
    FORM prepare_field_catalog .
      PERFORM fill_catalog USING:
    'Table Name'   'Field Name' 'NoZero'   'sel-text'
      'GI_OUTPUT'  'CHECKBOX'   ' '           text-013  'X',
      'GI_OUTPUT'  'KUNNR'      'X'           text-003  ' ',
      'GI_OUTPUT'  'NAME1'      ' '           text-004  ' ',
      'GI_OUTPUT'  'BELNR'      'X'           text-005  ' ',
      'GI_OUTPUT'  'BLART'      ' '           text-006  ' ',
      'GI_OUTPUT'  'BUDAT'      ' '           text-007  ' ',
      'GI_OUTPUT'  'BLDAT'      ' '           text-008  ' ',
      'GI_OUTPUT'  'DMBTR'      ' '           text-009  ' ',
      'GI_OUTPUT'  'WAERS'      ' '           text-010  ' '.
    ENDFORM.                    " PREPARE_FIELD_CATALOG
    *&      Form  FILL_CATALOG
          text
    FORM fill_catalog  USING    fv_tabname
                                fv_fldname
                                fv_nozero
                                fv_seltxt
                                fv_checkbox.
      DATA f_fldcat TYPE lvc_s_fcat.
      f_fldcat-fieldname     = fv_fldname.
      f_fldcat-tabname       = fv_tabname.
      f_fldcat-no_zero       = fv_nozero.
      f_fldcat-coltext       = fv_seltxt.
      f_fldcat-checkbox      = fv_checkbox.
      IF fv_checkbox = gc_x.
        f_fldcat-edit = gc_x.
      ENDIF.
      APPEND f_fldcat TO gi_fieldcat.
    ENDFORM.                    " FILL_CATALOG
    *&      Form  PREPARE_LAYOUT
          text
    FORM prepare_layout .
      gs_layout-info_fname = 'COL'.
      gs_layout-cwidth_opt = gc_x.
      gs_layout-zebra      = gc_x.
      gs_layout-no_toolbar = gc_x.
      gs_layout-no_rowmark = '1'.
      gs_layout-sel_mode = 'A'.
    ENDFORM.                    " PREPARE_LAYOUT
    *&      Form  DISPLAY_OUTPUT
          text
    FORM display_output .
      CALL METHOD gv_grid->set_table_for_first_display
        EXPORTING
          is_layout       = gs_layout
        CHANGING
          it_outtab       = gi_output
          it_fieldcatalog = gi_fieldcat.
      CREATE OBJECT event_receiver.
      SET HANDLER event_receiver->handle_user_command FOR gv_grid.
    CALL METHOD cl_gui_control=>set_focus EXPORTING control = gv_grid.
    ENDFORM.                    " DISPLAY_OUTPUT

  • LinkBar: how to set a selected button's background color?

    I was able to set the text color of a selected LinkBar button by "disabledColor" style of LinkBar. Accordingly, I expect to set the background color of the selected button by "backgroundDisabledColor" style, however, it didn't work; and except "backgroundDisabledColor", I didn't see any other style that could possibly achieve this. Please help. Thanks.

    Solved this myself by writing a programmatic skin and set it to LinkButton's disabledSkin.

Maybe you are looking for