Add a button to the branch/root in a Flex Tree

Can someone provide me code or  guide me how to  add a button to all nodes that has children/leaf( but not  to leaf). I tried from the example in this link
http://www.remwebdevelopment.com/dev/a31/Flex-Checkbox-TreeItemRenderer.html , but I ma getting buttons for all the nodes(including leaf).
i need to hav ethe button on the rideside corners horizontally to all branches/root.
Please correct me where i am wrong or provide me correct code. Thanks in advance
package  
PKG{
import mx.controls.Button;  
import mx.controls.Tree;  
import mx.controls.treeClasses.TreeItemRenderer;  
import mx.controls.treeClasses.TreeListData;  
public class TreeData extends TreeItemRenderer{
private var bWidth:Number = 30;  
private var bHeight:Number = 20;  
public function TreeData(){
super();}
var btn:Button=new Button();  
override protected function createChildren():void{
//addChild(btn);
super.createChildren();}
override public function set data(value:Object):void{
super.data = value;  
// get the tree that owns us  
var _tree:Tree = Tree(this.parent.parent);  
// if the current node is a branch node  
//for each(item:Object in  
if(TreeListData(super.listData).depth=1)                             -or if(TreeListData(super.listData).hasChildren)   these are not working for me{
btn.width = bWidth;
btn.height= bHeight;
btn.label=
"Remove Attachment";btn.right=10;
else{
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{ 
super.updateDisplayList(unscaledWidth,unscaledHeight); 
if(super.data){ 
var tld:TreeListData = TreeListData(super.listData); 
// if the current node is a branch node  
if(TreeListData(super.listData).depth=1){
this.btn.visible=true; 
this.btn.x=200; 
this.btn.y = super.label.y+4; 
//super.label.x = this.btn.x +; 
//this.btn.y = super.label.y+8; 
else{
this.btn.visible=false; 
this.btn.includeInLayout=false;}

Hi Albert.
You need to do a few things for that :
- Create your own GUI status by copying STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN.
- Set your own PF-Status using the Exclude table because otherwise your exclude table would become meaningless.
- define a subroutine to handle the user commands.
Sample implementation :
FORM pf_status USING extab TYPE slis_t_extab.
  extab = pf_exclude.   
  SET PF-STATUS 'STANDARD' EXCLUDING extab.       
ENDFORM.                    "PF_STATUS
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = repid
      i_callback_user_command  = 'USER_COMMAND'
      i_callback_pf_status_set = 'PF_STATUS'
      is_layout                = layout
      it_fieldcat              = fieldcat
      it_excluding             = pf_exclude
    TABLES
      t_outtab                 = itab
    EXCEPTIONS
      OTHERS                   = 0.
        FORM user_command  USING r_ucomm LIKE sy-ucomm
                                   rs_selfield TYPE slis_selfield.
ENDFORM.
Please reward points if found helpful.

Similar Messages

  • How to add a button on the ALV LIST pop up

    Hi ,
    Can any one help me to add a button on the ALV list which is a pop up using ABAP Objects.
    Thanks in advance.
    Regards,
    Kavya.

    HI ,
    I want to add a push button on the ALV list out put which is comming as a pop up and I want this using classes and methods.
    I have got a method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS from class cl_gos_attachment_list  but still I am unable to get any additional button on the output ALV popup.
    Please help.
    Regards,
    Kavya.

  • How to add a button to the toolbar of standard transaction

    hi friends
    currently i am working in IS-OIL(DS)-TSW module, in which we need to add a button to the toolbar of standard transaction(O4nm)
    can anybody help me how to proceed with this
    with regards
    s.janagar

    Hi,
    To be able to add a button to the toolbar of a standard transaction, you can use GuiXT which is a bundled solution within SAP R/3 or Netweaver.  With GuiXT, you can create your own pushbuttons within an R/3 screen or within the toolbar. You can make both the menu functions and the navigation to other transactions directly accessible with your own pushbuttons along with a new icon that you wanted to assign to the pushbuttons.
    Also, you can customize the pushbutton's size effortlessly.  And in your situation of adding it to the toolbar, GuiXT can help to set your pushbuttons automatically to fit onto the toolbar with its designer tool.
    For more information about front end changes, you can view more information about GuiXT at http://www.guixt.com/site/solutions.php
    Thank you and hope this helps!

  • How to add a button to the grouped data in an AdvancedDataGrid?

    Hi,
    Can anyone please suggest how to add a button to the grouped data in the AdvancedDataGrid?
    I have tried extending the AdvancedDataGridGroupItemRenderer and using it as the groupItemRenderer but its not reflecting.
    For the leaf node the itemRenderer property works just fine.
    Please help!

    HI ,
    I want to add a push button on the ALV list out put which is comming as a pop up and I want this using classes and methods.
    I have got a method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS from class cl_gos_attachment_list  but still I am unable to get any additional button on the output ALV popup.
    Please help.
    Regards,
    Kavya.

  • Need To Add One Button in The Output

    Hi Freinds,
    can any one tell how to add one button in the application
    tool bar, that is at the final ALV out put screen

    Hi,
    you just create a pf status and add buttons to it.
    then you include that pfstatus in your function module in the
    export parameter 'i_callback_pf_status_set'
    i found this sample code somewhere you just see how this is done:
    create one pfstatus. for example znewstatus is the created
    pfstatus. double click on the pfstatus that was created then add the buttons that you require in the appilication tool bar.
    pass the form names to the I_CALLBACK_PF_STATUS_SET and I_CALLBACK_USER_COMMAND in grid as shown below.
    example for reference:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
    SET PF-STATUS 'ZNEWSTATUS'.
    ENDFORM.
    FORM USER_COMMAND USING R_UCOM TYPE SY-UCOMM R_SELFIELD TYPE SLIS_SELFIELD.
    case R_UCOM
    when 'PRINT'. (print is the function code name given to the icon created)
    leave to list-processing.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = pass the form name
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FMNAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 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.
    CALL FUNCTION FMNAME.
    reward if useful.
    Nishant Rana

  • How to Add Print Button in the Online Payslip

    Dear Friends,
    How to Add Print Button in the Online Payslip (Employee Self Service). Can anyone pls let me know about this ..
    with regards
    Swpana

    Hi,
    Please review the following documents.
    Note: 332402.1 - Can You Mass Print Of Online Payslips?
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=332402.1
    Note: 256072.1 - Payslip V4.0 Print Button Is Missing
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=256072.1
    For details about Deposit Advise and Checkwriter, please refer to:
    Note: 459306.1 - XML Checkwriter/Deposit Advice
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=459306.1
    Regards,
    Hussein

  • Disable Add Attach Button in the Interactive PDF form

    Hi all,
    Can you please let me know if is possible to disable the Add Attachment Button for the interactive form?
    I need to show the attachment icon on the toolbar (setShowOption method from IWDPDFDocumentAppearance interface) but I need to disable the ability to add an attachment.
    Thanks in advance for your time.
    Regards,
    Mirco

    Hi Mirco,
    check below link may be it will help you
    Re: Disable Save Button in the Interactive PDF form

  • Add a button on the Table view screen

    Hi ,
    i need to add a button to da table view screen for which i have created a transaction also.How do i go about it?
    please help.
    Thanx and Regards,
    Srestha

    <div><button
    style="float:left;">LEFT</button><button
    style="float:right;">RIGHT</button></div>
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "-Michael--" <[email protected]> wrote in
    message
    news:edf6hm$aea$[email protected]..
    > How do i add a button at the top left side of the
    screen, then in the same
    > row
    > add a button to the right side of the screen. (I want
    the buttons to stay
    > left
    > and right nomatter how big the users computer screen is)
    >

  • HT4993 the add call button and the merge button isnt working.

    I have had my sprint I phone 5 for about 5 days.  I use my phone for business and Im not able to use the add call button or the merging button for conference calls.  It almost makes me want to take it back and grab a droid.  I really believe in mac I have 3 laptops but this I phone just isnt working properly.  Does anyone have any idea what could be the problem?

    Contact Sprint and see it this is a feature that they support. To the best of my knowledge they do not support it.

  • HT1535 I do not get the "add to"' button on the right of the screen to add items to my iphone.  Help?

    I do not get the "add to" button on the right side of the screen to add items to my iphone.  Help?

    Please see your other post for an answer.  Thank you.
    Opening PDFs on iPad

  • The Add Printer button on the eprintcenter website on my screen is not working.

    I just registerd on the eprintcenter.com site and now I am trying to click on the +Add Printer button/icon to add my printer and it is not working. I have tried it in all different web browsers and it doesn't take me anywhere on any of the browsers. Sometimes I get the "javascript&colon;void(0)" message down in the left hand bottom portion of my screen when my mouse goes over that button. What is wrong? Is it your site or my computer?

    I'm having same problem

  • How to add a button in the view at a specific position

    Hi Gurus,
    We have a requirement :
    To add a button or image at a specific position in the view which is like an indicator showing different color
    based on another field .
    Example :
    Adding a button next to a drop down flield and changing the color of the button based on the name of the color choosen in the drop down .
    or Adding an image which can be changed based on the dropdown value or the value entered in the input field .
    Thanks ,
    Naval Bhatt.

    Hi,
    Create an Attribute ZINDICATOR , in the same context node in which the dropdown(picklist) attribute,exists.
    Let it be a CHAR 1 field.
    Implement GET_P and GET_ method.
    Pull this field beside the dropdown fields in view configuration.
    Now the code =>
    Implement the Get_P_ZINDICATOR for this attribute as explained by Robert
    Implement  Get_ZINDICATOR method as follows
      DATA:
         lr_current   TYPE REF TO if_bol_bo_property_access,
         lr_entity TYPE REF TO cl_crm_bol_entity,
         coll      TYPE REF TO if_bol_entity_col.
      lr_current ?= collection_wrapper->get_current( ).
    IF lr_current IS NOT BOUND.
       value = cl_thtmlb_util=>get_icon_url( 'check_empty.gif' ).
       RETURN.
    ELSE.
       dref = lr_current->get_property( 'ZINDICATOR' ) .
    ENDIF.
    IF dref IS NOT BOUND.
        value = cl_thtmlb_util=>get_icon_url( 'check_empty.gif' ).
        RETURN.
    ENDIF.
    TRY.
        value = if_bsp_model_util~convert_to_string( data_ref       = dref
                                                                                attribute_path = attribute_path
          IF value IS INITIAL.
            value = cl_thtmlb_util=>get_icon_url( 'check_empty.gif' ).
    *      ELSEIF  value EQ 'R'
    *        value = cl_thtmlb_util=>get_icon_url( 'check_overdue_status.gif' ). " gives RED LIGHT
          ELSEIF  value EQ 'Y' .
            value = cl_thtmlb_util=>get_icon_url( 'check_due_status.gif' ). " gives YELLOW light
          ELSEIF  value EQ 'G'.
            value = cl_thtmlb_util=>get_icon_url( 'check_nodue_status.gif' ). " gives GREEN light
          ENDIF.
    CATCH cx_bsp_conv_illegal_ref.
          CLEAR value.
          RETURN.
    CATCH cx_root.
          CLEAR value.
          RETURN.
    ENDTRY.
    Generally check_overdue_status.gif and other images are std. and are present in all skins.
    You need more colors then you have to add those images in the MIME repository in the images folder of the SAP SKIN folder.
    You must implement the eventhandler for Dropdown field. For this in the GET_P method of dropdown, use
    CASE iv_property
      WHEN  if_bsp_wd_model_setter_getter=>fp_server_event.
          rv_value = 'COLOUR_SELECTED'.
    ENDCASE.
    and then implement the event handler EH_ONCOLOUR_SELECTED.
    In this event handler, you must set the ZINDICATOR value as ' ' , 'R','G','Y' etc depending upon what is selected in dropdown.
    This ensures that a server roundtrip is triggered and so the GET method of indicator field is called as soon as dropdown value
    is selected.
    Hope this helps.
    Thanks & Regards
    Suchita

  • Is it possible to add a button into the spliter area of a JSplitPane?

    I want to have a button in the spliter area of the JSplitPane. the purpose is to add an item from the upper component to the lower component. is it possible to do it in this way?

    the above link requires to register using $$$ before u can view the code, so poor me didn't go. but anyway, i worked out how to do this in the easiest way:
    JSplitPane mySplitPane = new JSplitPane();
    BasicSplitPaneDivider divider = ((BasicSplitPaneUI)mySplitPane.getUI()).getDivider();
    divider.setLayout(new FlowLayout());
    divider.add(new JButton("haha"));then u can try to show() this split pane in any frame or panel. just get the divider obeject then modify it in any manner u like.

  • Is it possible to add a button to the right-click context menu for a user in Outlook 2010 using VBA?

    I've tried many things and read up quite a bit but I cannot figure this out.
    I cannot create an add-in so I have to use VBA.
    I want to add a a button to the right-click context menu when I right-click on a user. Is this possible?

    Hello,
    Yes, it is possible to customize the context menu in Outlook. See
    Customizing Context Menus in Office 2010 for more information.
    But VBA doesn't allow to customize the Fluent UI in Outlook, you need to develop an add-in instead.

  • How to add a button to the home pages of the group wiki and user blog

    On the top of the home page of the group wiki page, there are several buttons/links like "wiki", "blog", "calendar" and "mail". I would like to add a button "svn" linked to "/svn/". Any one can help me? Thanks very much

    Hi Aravindhan,
    Try something like this:
    var ttDesvios = new sap.ui.table.TreeTable();
      var cbDesviacion = new sap.ui.commons.CheckBox();
      ttDesvios.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Col1"}),
      template: new sap.ui.commons.Label({text: "Info"}),
      width: "50px",
      ttDesvios.addColumn(new sap.ui.table.Column({
      label: new sap.ui.commons.Label({text: "Action"}),
      template: new sap.ui.commons.Button({text: "Delete"}).bindProperty("visible", "pathPropertyChild", function(value){
              if(value .............){ return true;} //For child
              else{ return false;} //For parent
      width: "160px",
    Regards
    EDIT: Wrong paste code, that's better!

Maybe you are looking for

  • Print Word File from Oracle Report Builder 6.0

    Dear All I am using Reports 6 , I have a requirement that i have to print a word document (somewhere around 8 to 9 pages) after printing a report is there any way to execute the same. The word file has the details like agreement , etc so each and eve

  • Splitting file into equal sized subfiles

    My code is supposed to read in a file, and split it into 5 equal sized files. However, at the moment it is only splitting it by paragraphs, skipping a newline character, for example in the text below, the line after "...liked...mainly because it does

  • Max Hard drive size KM3M-V

    Hi.  I wanted to know what the maximum hard drive size is on the KM3M-V Thanks  

  • Web trx: edit service test session parameters - separator?

    EM 10.2... I'm trying to monitor performance of Oracle iProcurement, and the tech stack it uses (OA Framework) employs multiple session parameters (or mutiple names for the same one) -- transaction_id and _tid . So I need to use both of these as sess

  • Why won't iTunes sync album artwork to my iPhone?

    Today, I plugged my iPhone 3GS into my Windows 7 (32) computer. iTunes pops up and tells me that another computer is handling my library. Long story short- My phone loses everything. I decide to take this as a oppurtunity to fine tune my phone's libr