Custom button in FPM component

Hello experts,
In a requirement i want to add custom button in FPM_OIF_COMPONENT. For this i followed following steps -
1. In SE80 transaction open FPM_OIF_COMPONENT
2. Select the requisite component configuration.
3. Start Configurator.
4. In configuration, enter component name & configuration ID then select option 'Continue in Display mode'.
5. In display mode, in 'Additional Functions', select 'Create customization' or if configuration already exists, then select 'Edit Configuration'.
6. In toolbar schema, I added one toolbar element as 'Other Function' and set the properties as enabled checked and visibility as 'Is Visible'.
7. Save.
8. After this to control the action of the new button, i added the action 'ZACT' in 'CNR_VIEW' by enhancing the view.
9. In SPRO->SRM->Cross application basic settings->Extensions & fieldcontrol->Assign actions, i assigned the action to set type and business object.
10. Then in SPRO->SRM->Cross application basic settings->Extensions & fieldcontrol->Control Actions->Configure control on header level, I added PDO action type, BO type, PDO action enabled, dynamic class & method to control the button visibility.
After doing all the steps above, when i open the required window in SRM portal, I am unable to view the custom button added.
Please let me know where i am going wrong.

Hi Yayayi,
You need to refer FPM event id of the corresponding button but not action id. As you said you have given FPM_EVENT_ID as ZACT, write the code in process event of component controller of  your WDP component in which IF_FPM_UI_BUILDING_BLOCK interface has been re-implemented.
But dont forget to follow the below steps shown in snapshot.
Hope this helps you.
Thanks
KH

Similar Messages

  • Close a popup window with a custom button

    Hi All,
    I have two components A and B.
    I will call one of the view of B in A as a pop up
    Component A
    Component B
    as popup
    BTN
    Pressing of BTN which is a custom button created in component B must close the popup screen(Exit Component B).
    I have tryied using Exit outbound plug in the corresponding window of Component B, but still it is not closing.
    Can any one help me to solve this problem?

    OK here is the logic for the second option..
    1. create a node in the component controller of the component B. make it interface node. ( say its name as WIN_NODE)
    2. create an attribute there of type (type ref to IF_WD_WINDOW)   (name as WIN)
    3. create the same node in the view where you have the close button (custom close button). map it to the component controller
          node.
    then the same node will be present in the interface controller
            view                         component controller                      interface controller
          WIN_NODE-->WIN_NODE--
    >WIN_NODE
              WIN-->WIN--
    >WIN
    now go to the component A,
    there you must have declared component B as the used component.
    4.go the view which fires the window creation .
    5. there go to the properties tab and add the interface controller or Component B as used controller.
    6. After that go to context tab and create a node WIN_node having attribute WIN there also.
    7. Map it to the node of interface controller of component B.
    8. Now the coding part.
    a.)   in the component A which fires the event of opening the window, write the following code in the event handler.
    data lo_window_manager type ref to if_wd_window_manager.
    data lo_api_component  type ref to if_wd_component.
    data lo_window         type ref to if_wd_window.
    lo_api_component  = wd_comp_controller->wd_get_api( ).
    lo_window_manager = lo_api_component->get_window_manager( ).
    lo_window         = lo_window_manager->create_window_for_cmp_usage(
                       interface_view_name    = 'WIN2'
                       component_usage_name   = 'TEST'
    *                  title                  =
                       close_in_any_case      = abap_true
                       message_display_mode   = if_wd_window=>co_msg_display_mode_selected
      DATA lo_nd_win_node TYPE REF TO if_wd_context_node.
      DATA lo_el_win_node TYPE REF TO if_wd_context_element.
      DATA ls_win_node TYPE wd_this->element_win_node.
      DATA lv_win LIKE ls_win_node-win.
    * navigate from <CONTEXT> to <WIN_NODE> via lead selection
      lo_nd_win_node = wd_context->get_child_node( name = wd_this->wdctx_win_node ).
    * get single attribute
      lo_nd_win_node->set_attribute(
        EXPORTING
          name =  `WIN`
          value = lo_window ).
    lo_window->open( ).
    you might be already having the code for opening and creating the window add the logic for passing the window instance to
    context there as shown above.
    b) in the context B fetch the window instance in the eventhandler of the close button and close it.
    DATA lo_nd_win_node TYPE REF TO if_wd_context_node.
        DATA lo_el_win_node TYPE REF TO if_wd_context_element.
        DATA ls_win_node TYPE wd_this->element_win_node.
        DATA lv_win LIKE ls_win_node-win.
    *   navigate from <CONTEXT> to <WIN_NODE> via lead selection
        lo_nd_win_node = wd_context->get_child_node( name = wd_this->wdctx_win_node ).
    *   get element via lead selection
        lo_el_win_node = lo_nd_win_node->get_element(  ).
    *   get single attribute
        lo_el_win_node->get_attribute(
          EXPORTING
            name =  `WIN`
          IMPORTING
            value = lv_win ).
    lv_win->close( ).
    thanks
    Sarbjeet singh

  • Custom Button in Sap Standard webdynpro Component

    Hi Friends,
    i have one requirement
    1. want to added one custom Button in SAP SRM standard webdynpro component - This is done using component configurator
    2. but when i click this button, one   Z webdynpro component should run,
    Can any one please give me  idea on this
    Thanks and Regards
    Kumar Srini

    Hi,
    copy below given code and paste inside of your on action method,
    Note: just change the url address
    data: l_window type ref to if_wd_window_manager.
    data: l_cmp_api type ref to if_wd_component.
    data: str             type stinrg.
    data: result        type if_wd_window.
    CALL METHOD cl_wd_utilities=>construct_wd_url
    EXPORTING
    application_name = 'ZWEBDYNPRO COMPONENT NAME'
    IMPORTING
    out_obsolute_url = str.
    l_cmp_api = wd_comp_controller->wd_get_api( ).
    l_window = l_cmp_api->get_window_manager ( ).
    result = l_window->create_external_window(
    url = str ).
    result->open( ).

  • Custom Button Component, addChild adds behind button style

    Hello,
    I'm making a custom button with a brandinglogo on it. The branding logo is an mc that changes logo depending on the area of the user.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Button xmlns:mx="http://www.adobe.com/2006/mxml" styleName="branding" addedToStage="addBranding()">
         <mx:Style source="styles/styles.css"/>
         <mx:Script>
              <![CDATA[
                   import mx.core.UIComponent;
                   import localisation.BrandingLogo;
                   private var brandCont:UIComponent = new UIComponent();
                   private var brandLogo:BrandingLogo = new BrandingLogo();
                   private function addBranding():void
                        addChild( brandCont );
                        brandCont.addChild( brandLogo );
                        setChildIndex( brandCont, numChildren-1 );
              ]]>
         </mx:Script>
    </mx:Button>
    But for some reason it puts the logo behind the button. Any idea's?

    "createChildren()" is one of the core lifecycle methods of UIComponent. It is called once when a component is first added to the display-list. You override this method if you want to add additional child objects to your component. It is described at the links below, but the best way to learn about how to use these core methods is by browsing the Flex SDK source code:
    http://livedocs.adobe.com/flex/3/html/ascomponents_advanced_3.html
    http://www.adobe.com/livedocs/flex/3/langref/mx/core/UIComponent.html#createChildren()
    The layoutContents() method is an mx_internal method of Button. It isn't documented, so the only way to learn about it is by looking at the source code for the Button class.
    The following code may help you get started:
    package
    import flash.display.DisplayObject;
    import mx.controls.Button;
    import mx.core.mx_internal;
    use namespace mx_internal;
    public class CustomButton extends Button
      private var extraLogo : Logo;
      protected override function createChildren() : void
       super.createChildren();
       extraLogo = new Logo();
       addChild( extraLogo );
      override mx_internal function layoutContents(
         unscaledWidth:Number,
         unscaledHeight:Number,
         offset:Boolean):void
          super.layoutContents( unscaledWidth, unscaledHeight, offset );
             if (currentSkin)
                 setChildIndex(DisplayObject(currentSkin), numChildren - 1);
             if (currentIcon)
                 setChildIndex(DisplayObject(currentIcon), numChildren - 1);
             if (extraLogo)
                 setChildIndex(DisplayObject(extraLogo), numChildren - 1);   
             if (textField)
                 setChildIndex(DisplayObject(textField), numChildren - 1);

  • How to add a custom button?

    Hello Gurus,
    I'm very new to FPM and I got a question regarding to adding a custom button in portal.
    I have read some documents but couldnt figure it out.
    Can somebody please clarify the issue?
    Thanks in advance.
    Ferhat
    Edited by: iltern on Feb 29, 2012 7:48 PM

    Hi Ferhat
    First you need to identify in which area you want to add the buttom.
    Then expand  the webdynpro application for that webdynpro component.
    Under that you will see application configuration. Dobule click on the configuration name .
    Then on right hand side you will get the option Open configuration.
    This will take you to the application configuration screen .
    Click on  Component Configuration.
    Then click on the edit button .
    After pressing the edit button on the screen there will be option for Adding the toolbar button.

  • How can I create a custom button for opening a form?

    I have a parent form having child forms. In my main form I want to create custom buttons for opening child forms. I want to use master-detail form but there are more than one child forms, and in master-detail form I can only create one detail form. So I will create a form based on a table and in that form I will call the child forms by custom buttons. Can I do that?
    Thanx,
    Gulsah.

    This can be easily done. First open up two instances of your Portal. In one window, you will need to go into your component you wish to link FROM. In the other window you will need to go into your component you wish to link TO. In the component you wish to link TO there will be a moduleid. Note this somewhere. Then, you will see an area that says: "Call Interface: Show". Click on this. (In the window you are linking to.). In this window, you will see a bunch of stuff. At the bottom you will see a URL call. This is the call you need to use. At the top, it explains each piece of the URL call. Just subsitute YOUR appropriate information into the URL call. In the form you wish to link FROM, create a button. Once you create this button, it will appear at the bottom, click on it and you will see an area to insert a Javascript. Click the onClick and insert:
    //this is the variable you want to pass from one form to the other
    get_field_name = getField(this.form,'COLUMN_NAME_IN_DATABASE');
    //this is so you can open the "child" form
    window.open('/pls/cc_prod/DAD_NAME.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=MOD_ID_HERE&p_arg_names=_sessionid&p_arg_values=&p_arg_names=COLUMN_NAME_IN_DATABASE&p_arg values='+GETFIELD_NAME+'&p_arg_names=_COLUMN_NAME_IN_DATABASE_cond&p_arg_values=%3D');
    In the fourth tab, where it says, "....before displaying form" insert the following: (This will tell the form how to handle the getField function.)
    htp.p('<script language="JavaScript1.3">
    < !--
    function getField(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    for (var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName)
    return form.elements[i].value;
    //-->
    </script>');
    I hope this helps.
    null

  • How to control Action in a Custom Button - SRM 7.0

    Hi SRM gurus,
    We have an issue to add a new button in Bidder responseu201D window when we process an RFX. We follow these steps:
    1. Defined and designed a new action called ZZMYACTION, type u201805u2019 (header) and for BUS2202 (Vendor Bid).
    2. Configured the control of action on header level for displaying and editing.
    3. Added a new button in Webdynpro Component FPM_OIF_COMPONENT, configuration ID /SAPSRM/WDCC_FPM_OIF_QTE_PURCH. It was added as u201COTHER_FUNCTIONSu201D button. It was configured with ELEMENT ID = u2018ZZMYACTIONu2019 and FPM Event ID = u2018ZZMYACTIONu2019.
    4. We created a post-exit for method ONACTIONBUTTON_PRESSED in view CNR_VIEW of the webdynpro. We encode this post-exit following next thread:
    So we have the control of the button. We have now a problem, because we raise our event ZZMYACTION, butu2026 ¿how can we configure this event? The purpose of this button is send an email to the bidder answering him about the result of the RFX, but I donu2019t know where do I have to put my code to do this.
    Anybody can help me to define the event? What am I missing? In addition, I would like to know in the event the bidder, sou2026 how do I send this to my code?
    Many thanks in advance
    Best regards,
    Valentín.

    Hi Valentín,
    If you want to control the event raised by your button, you should create a post-exit in class /SAPSRM/CL_CH_WD_IDEN_PUR_RFX, method /SAPSRM/IF_CLL_IDENT_MAPPER~HANDLE_EVENT. I hope this can help you.
    There you can find a standard example to implement your code. It could be like this:
        DATA:      lv_qte_guid            TYPE bbp_guid,
                       lv_parent_guid         TYPE bbp_guid,
                       lv_folder_url          TYPE string,
                       ls_url_components      TYPE /sapsrm/s_wd_ui_url_components,
                       lo_navigation_service  TYPE REF TO /sapsrm/if_ch_wd_navi_serv,
                       lo_cmp_api             TYPE REF TO if_wd_controller,
                       lo_comp                TYPE REF TO if_wd_component,
                       lo_window_manager      TYPE REF TO if_wd_window_manager,
                       lo_ext_win             TYPE REF TO if_wd_window,
                       lo_task_container      TYPE REF TO /sapsrm/if_cll_task_container,
                       lv_url                 TYPE string,
                       lo_bom_qte             TYPE REF TO /sapsrm/if_cll_bom_qte,
                       lo_comp_controller     TYPE REF TO /sapsrm/iwci_wdi_l_fpc_general,
                       lo_techbid             TYPE REF TO /sappssrm/cl_techbid_cfolder,
                       lv_urlpart2            TYPE string,
                       lt_partner             TYPE TABLE OF  bbp_pds_partner,
                       ls_partner             TYPE bbp_pds_partner,
                       lv_bidder_guid         TYPE bu_partner_guid,
                       ls_obn_components      TYPE /sapsrm/s_wd_ui_obn,
                       lt_url_params          TYPE wdy_key_value_table,
                       ls_key_value           TYPE wdy_key_value,
                       lv_title               TYPE string,
                       lo_portal_mngr         TYPE REF TO if_wd_portal_integration,
                       lo_message_handler     TYPE REF TO /sapsrm/if_ch_wd_map_msg_hdlr,
                       lx_pdo_error_gen       TYPE REF TO /sapsrm/cx_pdo_error_gen.
        TRY.
            CALL METHOD core_object->get_task_cont(
                      IMPORTING eo_task_container = lo_task_container ).
            lo_bom_qte         = lo_task_container->get_bom_qte( ).
            CALL METHOD core_object->get_task_cont(
                      IMPORTING eo_comp_controller = lo_comp_controller ).
            CALL METHOD lo_bom_qte->get_parent_bo_details
              IMPORTING
                ev_parent_guid = lv_parent_guid.
            CALL METHOD lo_bom_qte->/sapsrm/if_cll_bo_mapper~get_bo_guid
              RECEIVING
                rv_bo_guid = lv_qte_guid.
            CASE io_event->mv_event_id.
              WHEN 'ZZMYACTION'.
                   Your code here.....
            ENDCASE.
          CATCH /sapsrm/cx_pdo_error_gen INTO lx_pdo_error_gen.
            lo_message_handler->add_exception( io_pdo_error_exception = lx_pdo_error_gen ).
        ENDTRY.

  • Add customer button on header level for BUS2201(PO) - SRM 7.0

    Hi,
    I want to define a customer button (with action) within PO on header level.
    Web Dynpro           FPM_OIF_COMPONENT
    Configuration          /SAPSRM/WDCC_FPM_OIF_PO_PURCH
    Task:
    Add a customer button besides standard Export button.
    I assume-afterwards I have to enhance the method onactionbutton_pressed to create my event when customer button is pressed, right?
    Could anyone please guide me how to solve this issue?
    Thanks and best reagrds
    Andreas

    Hi,
    Here are the steps to add the button, I wrote it in other thread. In my case for PO is not displayed, try to follow the steps and if you are able to show the button tell me how please.
    Add custom button in PO
    And yes ,you need to create an enhancement point in the view CNR_VIEW of the component FPM_OIF_COMPONENT, you need to create a post-exit in the method BUTTON_PRESSED, here you have a sample code:
    DATA: lv_id TYPE string,
            lv_event_id TYPE fpm_event_id.
      DATA: lo_nd_oif_application TYPE REF TO if_wd_context_node,
            lo_nd_variant TYPE REF TO if_wd_context_node,
            lo_nd_toolbar TYPE REF TO if_wd_context_node,
            lo_nd_button TYPE REF TO if_wd_context_node,
            lo_el_button TYPE REF TO if_wd_context_element,
            lo_nd_other_functions TYPE REF TO if_wd_context_node.
      DATA: lv_substring TYPE string,
            lv_substring_i TYPE i,
            lv_node_name TYPE string,
            lv_position TYPE string,
            lv_length TYPE i,
            lv_seq TYPE i.
      DATA:lt_keys TYPE STANDARD TABLE OF string,
           lv_key LIKE LINE OF lt_keys.
      TYPES:BEGIN OF y_parameters,
        name TYPE string,
        value TYPE string,
      END OF y_parameters.
      DATA: lt_parameters TYPE STANDARD TABLE OF y_parameters,
            ls_parameter LIKE LINE OF lt_parameters.
      DATA: lv_boid      TYPE bbp_guid,
            lv_botype    TYPE string,
            lv_objkey TYPE  swo_typeid,
            lv_objtype  TYPE  swo_objtyp,
            lv_object_id TYPE crmt_object_id_db,
            lv_process_type TYPE crmt_process_type_db,
            lv_object_type TYPE crmt_subobject_category_db,
            lv_rfc TYPE zgrs_co_logsys-rfc,
      DATA: lo_fpm TYPE REF TO if_fpm.
      lo_fpm = cl_fpm_factory=>get_instance( ).
      lo_fpm->raise_event_by_id( lv_event_id ).
      lt_keys = lo_fpm->mo_app_parameter->get_keys( ).
      LOOP AT lt_keys INTO lv_key.
        ls_parameter-name = lv_key.
        lo_fpm->mo_app_parameter->get_value(
          EXPORTING  iv_key = lv_key
          IMPORTING  ev_value = ls_parameter-value  ).
        INSERT ls_parameter INTO TABLE lt_parameters.
      ENDLOOP.
      lv_id = wdevent->get_string( 'ID' ).
      lo_nd_oif_application = wd_context->get_child_node( name = wd_this->wdctx_oif_application ).
      lo_nd_variant = lo_nd_oif_application->get_child_node( name = wd_this->wdctx_variant ).
      lo_nd_toolbar = lo_nd_variant->get_child_node( name = wd_this->wdctx_toolbar ).
      lo_nd_other_functions = lo_nd_toolbar->get_child_node( name = wd_this->wdctx_other_functions ).
      lv_substring = lv_id.
      lv_length = STRLEN( lv_id ).
      lv_seq = lv_length - 3.
      IF lv_id+lv_seq = '_CP'.
        lv_substring = lv_substring(lv_seq).
        lv_id = lv_substring.
      ENDIF.
      WHILE lv_substring CS '_'.
        lv_position = sy-fdpos + 1.
        lv_substring = lv_substring+lv_position.
      ENDWHILE.
      IF lv_substring CO '1234567890'.
        lv_substring_i = lv_substring.
      ENDIF.
    * Item level action;
      IF lv_id CS '_item'.
    * Or header level action;
      ELSE.
        IF lv_id CA '0123456789'.
          lv_position = sy-fdpos - 1.
          lv_node_name = lv_id(lv_position).
          IF lv_id CS 'OTHER_FUNCTIONS'.
            lo_nd_button = lo_nd_other_functions->get_child_node( name = wd_this->wdctx_button ).
            lo_nd_button->set_lead_selection_index( index = lv_substring_i ).
            lo_el_button = lo_nd_button->get_element(  ).
            TRY.
                lo_el_button->get_attribute(
                EXPORTING
                  name =  `EVENT_ID`
                IMPORTING
                  value = lv_event_id ).
              CATCH cx_wd_context.
            ENDTRY.
            READ TABLE lt_parameters INTO ls_parameter WITH KEY name = 'SAPSRM_BOTYPE'.
            lv_botype = ls_parameter-value.
            READ TABLE lt_parameters INTO ls_parameter WITH KEY name = 'SAPSRM_BOID'.
            lv_boid = ls_parameter-value.
    *         Obtain the object_id;
            SELECT SINGLE object_id INTO lv_object_id
             FROM crmd_orderadm_h
             WHERE guid EQ lv_boid.
    *         If not Z button, exits;
            IF lv_event_id(1) NE 'Z'. EXIT. ENDIF.
    *      Actions;
            CASE lv_event_id.
              WHEN 'ZBUTTON'.
              WHEN 'ZBUTTON2'.
            ENDCASE.
          ENDIF.
        ENDIF.
      ENDIF.

  • Centering text on a custom button

    I have created a custom button, which extends canvas. I would like it to be possible to add a label, via constructor. I've tried to add the "Label" component, since it has its own centering facility, but cant seem to add to a canvas nor a component extended class. Ive created a string which kind of sits in the middle, but as the string gets bigger it doesn't align correctly. Does anyone have any ideas of how to get around this?

    Use FontMetrics.stringWidth() to calculate the size of the string
    http://java.sun.com/docs/books/tutorial/uiswing/painting/drawingText.html

  • Custom button skin with scaleGrid 9 slice image does not appear in Design Mode

    So in a custom button skin I have a nine sliced image, and then throw that onto an MXML page. In design view, I cannot get the component to show the image that I've thrown on it. Unless I do a hack on the MXML page by adding the image in it's scaleGrid form to the page somewhere. Then it seems to act as like a preloader for the image so it actually displays. But I don't want to do this hack on every page that uses this component. Is there a work around?
    Here's the button skin:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        width.disabled="296" height.disabled="73">
    <!-- host component -->
    <fx:Metadata>
                        [HostComponent("spark.components.Button")]
                        [Embed('assets/art/shared/[email protected]', scaleGridTop=20, scaleGridBottom=85, scaleGridLeft=40, scaleGridRight=60)]
    </fx:Metadata>
    <!-- states -->
    <s:states>
                        <s:State name="disabled" />
                        <s:State name="down" />
                        <s:State name="over" />
                        <s:State name="up" />
    </s:states>
              <s:Group width="100%" height="100%" >
      <s:Image width="100%" height="100%" smooth="true" source="@Embed('assets/art/shared/[email protected]', scaleGridTop=20, scaleGridBottom=85, scaleGridLeft=40, scaleGridRight=60)"/>
    </s:Group>
    <!-- text -->
              <s:Label id="labelDisplay" left="10" right="10" top="2" bottom="2" horizontalCenter="0"
                                   maxDisplayedLines="1" textAlign="center" verticalAlign="middle" verticalCenter="1"
                                   color="#FFFFFF" >
      <s:filters>
                                  <s:DropShadowFilter distance="0" angle="90" color="0x000000" alpha="1" blurX="2" blurY="2" strength="16" quality="3" />
      </s:filters>
    </s:Label>
    </s:Skin>
    And then I throw that button into an MXML page. The image doesn't show up in design view.
    <s:Button x="330" y="94" width="134" height="57" label="Button" skinClass="features.shared.NineSliceButtonSkin" />
    This hack, fixes the button! And all other buttons that use that skin.
    <s:Image width="100%" height="100%" smooth="true" source="@Embed('assets/art/shared/[email protected]', scaleGridTop=20, scaleGridBottom=85, scaleGridLeft=40, scaleGridRight=60)"/>
    <s:Button x="330" y="94" width="134" height="57" label="Button" skinClass="features.shared.NineSliceButtonSkin" />

    Looking for an answer too!

  • Custom button and Custom fields in item data tab of SRM shopping cart

    Hello All,
    I am new to SRM 7.
    There is a requirement to add a custom button and on the click of a button I need to pop up some custom fields , and
    store it in SRM system.
    The webdynpro component is /SAPSRM/WDC_UI_SC_DOFC_D1.
    Can you pls tell me the process of adding, popup and transfer of the fields to SRM tables.
    Should we adding some fileds in SPRO->Extensions and field control.
    Kindly help.
    Regards
    Vinay

    Hi,
    I dont have access to SRM system but you can use enhancment concepts to enhance the standard component.
    Refer http://wiki.sdn.sap.com/wiki/display/SRM/HidingtabofShoppingcartinSAPSRM7.0 which is having something simmilar requirment.
    also refer http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/700317da-bd79-2c10-368e-8f18bf5d8b81?QuickLink=index&overridelayout=true
    I hope this will helpful for you to achive your requirments.
    Thanks,
    Chandra

  • Adding custom buttons to JOptionPane

    Hi,
    I need to add custom buttons to my showMessageDialogue boxes.
    I know that
    JOptionPane.showMessageDialog
    (null, "message body", "message title", JOptionPane.YES_NO_OPTION,
    JOptionPane.INFORMATION_MESSAGE);displays an information box with a 'Yes' and a 'No' button. But how do I include three or more custom buttons on such a box?
    For example, I want to display an information message box with buttons: 'Auto', 'Prompt' and 'Never'.
    What if I want to mix orthodox buttons, with my custom buttons? For example, putting 'Auto', 'Prompt' and 'Cancel' in one information message box?
    Thanks,
    Hasanka.

    Use the last method for showMessageDialog. The options[] paremeter can take an array of Strings and return to you which button was pressed (by index).
    showOptionDialog
    public static int showOptionDialog(Component parentComponent,
                                       Object message,
                                       String title,
                                       int optionType,
                                       int messageType,
                                       Icon icon,
                                       Object[] options,
                                       Object initialValue)Brings up a modal dialog with a specified icon, where the initial choice is dermined by the initialValue parameter and the number of choices is determined by the optionType parameter.
    If optionType is YES_NO_OPTION, or YES_NO_CANCEL_OPTION and the options parameter is null, then the options are supplied by the Look and Feel.
    The messageType parameter is primarily used to supply a default icon from the Look and Feel.
    Parameters:
    parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, a default Frame is used
    message - the Object to display
    title - the title string for the dialog
    optionType - an integer designating the options available on the dialog: YES_NO_OPTION, or YES_NO_CANCEL_OPTION
    messageType - an integer designating the kind of message this is, primarily used to determine the icon from the pluggable Look and Feel: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
    icon - the icon to display in the dialog
    options - an array of objects indicating the possible choices the user can make; if the objects are components, they are rendered properly; non-String objects are rendered using their toString methods; if this parameter is null, the options are determined by the Look and Feel.
    initialValue - the object that represents the default selection for the dialog
    Returns:
    an integer indicating the option chosen by the user, or CLOSED_OPTION if the user closed the Dialog

  • UI class for custom Button

    Hey frineds can any one tell me how can i make a UI class for my custom component?
    Let me explain this is detail
    I have a custom button called MyButton extended From JButton. I can change its appearance at runtime if i define my own UIClass called MyButtonUI which is extended from Basic ButtonUI.
    One way to apply the ui to Mybutton is using method setUI().
    But the much better way is to define our own look and feel class and setting defining buttonUI in it. This is done as follows
    protected void initClassDefaults(UIDefaults table)
            super.initClassDefaults(table);
            table.put ("ButtonUI", "MyButtonUI");
    }But this method sets the newly created UI to every swing button including the button used in comboBox !!
    Can Any one tell me how can i set the ui that is applicable only to MyButton.
    Thans in Advanced

    You should override the method getUIClassID() in your MyButton class which returns something like MyButtonUI. Then you put this in the default table:
    protected void initClassDefaults(UIDefaults table) {
            super.initClassDefaults(table);
            String pkg = ...;
            table.put ("MyButtonUI", pkg + "MyButtonUI");
    }Then you apply the UI only to your custom buttons.

  • Add custom button in MR11

    Hi,
    We want to add cusotm button on output screen of MR11.
    How can we add button on output screen of MR11?
    Regards,
    Jigar Thakkar.

    Hi Husalban,
    We added customer button in the rfx iview.
    When you finish the configuration adding, you can go to the WDA component 'FPM_OIF_COMPONENT'/View:CNR_VIEW/Methord:ONACTIONBUTTON_PRESSED.
    You can make repair here or continue to find the rfx PDO class.
    Please be careful when you decide to make repair code and considerate the upgrade.
    In the methord ONACTIONBUTTON_PRESSED,please refer to follow code:
    ***---->Add By lorry for test Action
        IF lv_event_id = 'ZAPPWLF' OR lv_event_id = 'ZAPPWLF_VIEW'.
    *****************Get the Parameter Vaule
          DATA:lt_keys TYPE STANDARD TABLE OF string,
               lv_key        LIKE LINE OF lt_keys.
          TYPES:BEGIN OF y_parameters,
                name TYPE string,
                value TYPE string,
                END OF y_parameters.
          DATA lt_parameters TYPE STANDARD TABLE OF y_parameters.
          DATA ls_parameter LIKE LINE OF lt_parameters.
          lt_keys = lo_fpm->mo_app_parameter->get_keys( ).
          LOOP AT lt_keys INTO lv_key.
            ls_parameter-name = lv_key.
            lo_fpm->mo_app_parameter->get_value(
             EXPORTING
             iv_key = lv_key
             IMPORTING
             ev_value =  ls_parameter-value
            INSERT ls_parameter INTO TABLE lt_parameters.
          ENDLOOP.
          DATA:ls_boid   TYPE bbp_guid,
               ls_botype TYPE string,
               ls_mode   TYPE string.
          CLEAR ls_parameter.
          READ TABLE lt_parameters INTO ls_parameter WITH KEY name = 'SAPSRM_BOID'.
          ls_boid = ls_parameter-value.
          CLEAR ls_parameter.
          READ TABLE lt_parameters INTO ls_parameter WITH KEY name = 'SAPSRM_BOTYPE'.
          ls_botype = ls_parameter-value.
          IF ls_botype = 'BUS2200'.
          ENDIF.
    ENDIF.

  • How to create a custom button/ double button

    First of all I am relative new to
    Java 2D programming; therefore,
    I am seeking some help and advice of
    how to create a complex double button
    a big one which is responsible for
    the use case and a small one which
    will show some help text if pressed.
    | |
    | Use Case _____________|
    | / |
    | | Help Case |
    | | |
    \ | /
    A 3D effect should distinct and signify whether the Use Case
    button area or Help Case button area is pressed.
    I am looking for some example or best practice that
    explains to me how to create a double button
    so that it can carry or depict at least a:
    1) Title
    2) Subtitle
    3) Pictogram (Graphic Icon)
    4) Round or organic borders
    5) 3D effect
    Thanks in advance.

    What you are asking here is something complex enough that nobody is going to explain it to you in one forum post. We are talking about creating your own custom button component. I would suggest you check out the book [Filthy Rich Clients|http://www.amazon.com/Filthy-Rich-Clients-Developing-Applications/dp/0132413930/].

Maybe you are looking for

  • Synching uimodel with the viewobject

    Is there a way to synch a uimodel with the viewobject ? The issue I have is, I have several attributes in my viewobject that I do not have the need to use in my application, I want to remove those attributes from the viewobject and anticipated that t

  • What is better?: Compiling with newest WTK or oldest WTK

    HI: I have installed the WTK 2.5. It's cool but I have a question. The MIDlets compiled with this new WTK are more or less compatible with older/newer phones? If I compile a MIDlet with this WTK instead a older WTK (like WTK 2.0) Executes the code mo

  • Can't Transfer user created mailboxes from G4 iMac to new Intel iMac 24"

    I recently purchased a new intel based 24" iMac and began setting it up. I ran the Migration Assistant to trnsafer user settings, applications and files. about 80% successful so far after two runs. However, I cannot transfer the various email boxes I

  • How to Ignore the errors while exporting

    Hi , i am trying to import a dump using imp command. Out of 10000 user objects, 5000 objects has got imported successfully. Meanwhile because of a LAN failure, import was not able to continue. And again i tried with import the same. System is trying

  • Date Function.

    Hi all, I have requirement to increase the given date for 3 months(ie., 01-jan-2011, 01-apr-2011,etc) that should be handled in RTF Template. can anyone help me in giving date function for increasing the date. Regards, Vinoth.