How to get the index of the clicked button on TOOLBARBUTTONCHOICE

Hello Experts,
   I have used toolbarbuttonchoice and created the dropdown list of the buttons dynamically. now when any of the button is clicked i need to get the reference of the button to call appropriate code in the action, but i am unable to get the either the reference or index of the clicked button.
Please help.
Regards,
Kinshuk

Hi Sascha,
  My code goes this way
  data:
    lr_btn_ch   type ref to if_wd_view_element,
    lr_toolbar_btn_choice type ref to cl_wd_toolbar_btn_choice,
    lr_row_data           type ref to cl_wd_row_data,
    item                  type string,
    action                type string.
CALL METHOD view->get_element
  EXPORTING
    id      = 'BTNCH'   " button choice Element in layout
  receiving
    element = lr_btn_ch
lr_toolbar_btn_choice ?= lr_btn_ch.
DATA:  lt_items      type string_table,
    lt_actions    type string_table.
loop at lt_dyntab into ls_dyntab.
  append ls_dyntab-name to lt_items.
append 'ONBTNCH' to lt_actions.
endloop. 
i get the data in the table lt_dyntab from API not in context
  loop at Lt_items into item.
    read table Lt_actions index sy-tabix into action.
    create_choice_item( i_toolbar_btn_choice = lr_toolbar_btn_choice i_item = item i_action = action i_view = VIEW ).
  endloop.
create_choice_item creates the menu item for the button choice..
My question is where should i call the map_on_action method. and how do i retrieve the index or reference in ONBTNCH method.
please elaborate.
Regards,
Kinshuk

Similar Messages

  • How to get the Clicked Item of a ListBox?

    I need to get the clicked item of a listbox.
    The item can be at first selected, when I click it again, it
    automatically gets de-selected, but I want to get that item
    whenever I click it. Any idea how to do this?
    This line does not work, because it gets the selected item.
    var pattern:String = event.currentTarget.selectedItem.myname;
    This one must work,but something is missing.
    Anyone can help me with this?
    marks is my ArrayCollection;
    var pattern:String =marks.getItemAt[??].myname;

    Here is my code. Am using this function in the itemclick
    event of the ListBox.
    My ListBox is a multi-select listbox. So am selecting several
    items by pressing "Ctrl" key and selecting each item using click.
    Say I have selected 4 items, when I press "Ctrl" and
    de-select one of the items, I want to get the itemname of the
    deselected item.
    public function createMarksList(event:ListEvent):void{
    // Alert.show(new
    String(event.currentTarget.selectedItem.myname));
    // var pattern:String =
    event.currentTarget.selectedItem.myname;
    // pattern = pattern += "," + pattern;
    // text1.text = pattern;
    <mx:List x="9" y="46" width="121" height="121"
    id="lstMarks" allowMultipleSelection="true"
    itemClick="createMarksList(event)"></mx:List>
    So, your help is required here buddy.
    I sitll can't figure out.
    Thx

  • How to get the printer button to appear

    The buttons on my printer should say scan, copy & print.
    They are now saying scan, copy & copy.   how do I get the print button back, as I cannot print

    Hi,
    What is the exact printer model? is it the HP Photosmart C4385?
    The following model does not provide any fax capabilities as you may find by its datasheet below:
    http://cdn.cnetcontent.com/b6/14/b6144c8e-0a16-4ce3-a66d-2eb03e86f4d9.pdf
    If I misunderstood your pritner model, please clarify the exact model.
    Regards,
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • How to get the back button if we to go the 2nd drill down report??

    Hi,
    I have a drill down report for the main report. And have detailed drill down as in 1st report>2nd report>3rd report.
    But once i goto drill down, the return button is there which directs to main report i.e. 2>1,
    But once i goto 3rd, i do not get the back button so that i can access reports in 3>2>1, instead its going directly to 1st from 3rd.
    hope i have made the point clear.
    Someone suggest me how do i get the back button??
    Thanks!!

    use the below code in Narrative view
    <script&gt;
    function goBack()
    window.history.back()
    </script&gt;
    <input type="button" value="Back" onclick="goBack()"&gt;
    If helps mark
    Edited by: Srini VEERAVALLI on Feb 13, 2013 12:08 AM

  • How to get the Search Button from RichQuery Component

    Hello All,
    How can I get the Search Button from RichQuery Componennt, I could do not locate from getChildren, getFacets
    any ideas ?
    Thank you,

    Not even able to get it from getViewRoot findComponent("clientId");
    which is not good, RichQuery component can be inside popup and I do not want to add an extra button just to close the popup window
    Any ideas ?
    Thank you,

  • How to get the command button component id  in bean class?

    Hi All,
    I'm using adf 11g.
    I'm having three command button , which have some similar code to use on fire of these buttons.
    if it possible to catch the component id in bean , i can use the code with little parameter passing .

    Hi,
    You can get the command button from the actionEvent (if you are writing a generic actionListener) and from it, you can get the Text of the command button. Using which, you can process accordingly.
    If the text also same, then set some client attribute for the command button (check out [url http://docs.oracle.com/cd/E21764_01/apirefs.1111/e12419/tagdoc/af_clientAttribute.html]af:clientAttribute), and from the actionListener, get the client attribute using getClientAttribute method and process accordingly.
    -Arun

  • Anyone know how to get the "emojes" button off?

    I dislike emojes.  I like being able to dictate my messages.  After the recent update the mic symbol next to the space bar has been replaced with a Happy Face.  Anyone know how I can get the mic back?

    Dictation is not listed as an option to enable. But I was able to get rid of the emoji keyboard. Yay!  Still no "mic" for dictation, though.

  • How to get the 'info' button working again in Spotlight?

    The 'info' button to get info about an item in the search results window of Spotlight is no longer working for me. I have tried reindexing and trashing the preference file in the user library, with no luck. Any idea how to get this functionality back?
    Thanks
    Chris

    I have the same problem after installing Safari 3, the more info icon in the spotlight results no longer works.
    Dan

  • How to get the None button on my account payment page

    I would like to remove my old credit card info from my account and start using only gift and prepaid iTune cards.  However, the None button is not showing on the page.  Is there some sort of pathway that I need to go through to get the button or do I have to have some other support for this function?

    I NEED TO GET MY ITUNE CARD TO MY ACCOUNT

  • How to get the status of the button?

    i want to know how to get the clicked status of the button? whether it is in clicked state or in unclicked state?
    For ex: i have the following code...
    <components:IconButton id="bold_btn" width="22" icon="@Embed('/assets/bold.png')" click="onBoldClick()" enabled="{this.loadCompleted}" toggle="true"/>
    how to find whether the bold button is clicked or not?
    this.bold_btn.????

    Hi Isa,
    You can make use of a Boolean variable to acheive this functionlaity...check out the below simple example...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout="vertical"
            verticalAlign="middle"
            backgroundColor="white" width="100%">
        <mx:Script>
            <![CDATA[
             import mx.controls.Alert;
             private var isBtnToggle:Boolean = false;
             private function onButtonClick():void
        isBtnToggle = !isBtnToggle;
        if(isBtnToggle)
         btnToggle.label = "I am Toggled ON";
         Alert.show("Button is Toggled ON");
        else
         btnToggle.label = "I am Toggled OFF";
         Alert.show("Button is Toggled OFF");
            ]]>
        </mx:Script>
        <mx:Button id="btnToggle" label="I am Toggled OFF" toggle="true" click="onButtonClick()" />
    </mx:Application>
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • How to get the instance name from the SWFLoader?

    Hi Guys,
    I am new to Flex. i need help from u.
    i load the swf file through the SWFLoader in Flex 3.
    Than how to get the instace(button,text,etc.,) of the loaded
    swf.
    Please help me.

    Yes. hashcode is not absolutely unique. I know this.
    I had took this idea into my consideration. But it failed finally.
    Thanks
    To JN_.
    Maybe I still have some misunderstood descripte my question.
    neither the name not an "instance name" nor an "object name".
    So now, I really do not know how to call this.
    Can you tell me? Then I will not make the same fault next time.
    thanks.

  • How to get the current slide Index or Id?

    I can get the selected slide of presentation use blow method.
    Office.context.document.getSelectedDataAsync(Office.CoercionType.SlideRange, function (asyncResult) {
    if (asyncResult.status == Office.AsyncResultStatus.Failed) {
    write('Action failed. Error: ' + asyncResult.error.message);
    else {
    write('Selected slides: ' + JSON.stringify(asyncResult.value.slides));
    But, How can I get the executor slide?

    ​Hi,
    >> How to get the current slide Index or Id?
    In my option, when you select a slide, it change to current slide. So, you could use the getSelectedDataAsync method to get the current slide, and then get the index or id by using the Slice object. You could refer the link below for Slice Object.
    # Slice.index property (JavaScript API for Office)https://msdn.microsoft.com/EN-US/library/office/jj715285.aspx?f=255&MSPPError=-2147217396
    Some key code as below:
    <script>
    function getText() {
    Office.context.document.getSelectedDataAsync(Office.CoercionType.SlideRange,
    { valueFormat: "unformatted", filterType: "all" },
    function (asyncResult) {
    var error = asyncResult.error;
    if (asyncResult.status === Office.AsyncResultStatus.Failed) {
    write(error.name + ": " + error.message);
    else {
    // Get selected data.
    var dataValue = asyncResult.value;
    write('Selected data is ' + dataValue.slides[0].index);
    // Function that writes to a div with id='message' on the page.
    function write(message) {
    document.getElementById('message').innerText += message;
    </script>
    >> How can I get the executor slide?
    What do you mean by this? Is this a new issue which is different from the above issue? If so, I will recommend you post a new thread for this issue and share us more information about this.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to get the index of selected values in SelectManyChoice...

    How to get the index of selected values in SelectManyChoice... the value which i get is coming when i submit the value second time

    By using the given code i get the value of the selected indices, but problem here is i get the value when it get submits at the second time... First time the length of that int array is 0.
    Second time it shows the value two times (i.e) First time submitted value and the second time submitted value. After that it works fine.. I have problem while clicking first time only..
    The Following error also raises.. One multiselect is dependent on other multiselect.
    DF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase PROCESS_VALIDATIONS 3
    java.lang.ArrayIndexOutOfBoundsException: 6
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.findObjectFromIndex(FacesCtrlListBinding.java:334)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.getInputValue(FacesCtrlListBinding.java:199)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.internalGet(JUCtrlValueBinding.java:2416)
         at oracle.jbo.uicli.binding.JUCtrlListBinding.internalGet(JUCtrlListBinding.java:3717)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.internalGet(FacesCtrlListBinding.java:500)
         at oracle.adf.model.binding.DCControlBinding.get(DCControlBinding.java:749)
         at javax.el.MapELResolver.getValue(MapELResolver.java:164)
         at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
         at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
         at com.sun.el.parser.AstValue.getValue(Unknown Source)
         at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)

  • How to get the index of a h:column element?

    Hi!
    I'd like to know how to get the index of a <h:column> element.
    Here is the code of what I'm trying to do:
    <h:column>
         <a:commandLink
              value="#{familyAction.familyDocsByPrj}"
              action="#{homeAction.search(ROW_INDEX)}"
              reRender="rightAppPanel" />
    </h:column>When clicking a row, I'd like to make a "search" depending on the selected row.
    Does anybode know how to do that?
    Thanks a lot :)

    Thanks a lot for all your answers! :)
    I finally got to do something with my little knowledge =P
    I created a new class containing all the data needed for the dataTable (including a "String id").
    And that's what I get:
    <h:column>
         <a:commandLink
              value="#{familyAction.familyDocsByPrj.name}"
              action="#{homeAction.search(familyAction.familydocsByPrj.id)}"
              reRender="rightAppPanel" />
    </h:column>

  • I-photo:  I used 2 cameras to take pictures on a trip --- i have put the pictures from both cameras into an album --- when i click on view and then sort by date, the pictures do not sort by date --- any ideas on how to get the pics sorted by date?

    I-photo:  I used 2 cameras to take pictures on a trip --- i have put the pictures from both cameras into an album --- when i click on view and then sort by date, the pictures do not sort by date --- any ideas on how to get the pics sorted by date?

    Select all the photos that you need to change, then click the "Photos" menu and choose "Adjust Date and Time".
    If you add a year, it will adjust all the photos that you selected by adding a year (so if you accidentally select one of the photos that already has "2012", that will change to "2013"). 

Maybe you are looking for

  • Links in pages on ipad

    I was wondering if when I export my pages via email why my links don't work? Can links work on documents when using pages on iPad?

  • Can any body please explain the hr payroll process  in detail

    Hi Experts,                   I am newbie to HR abap.Can any body give their valuable experience regarding payroll proces in hr. Thanks and Regards, Sravanthi.

  • It says I already have flash player.

    But it's not listed in my computer.

  • Database problems

    Hi all I have for the past 3 days, tried to build some kind of database, without luck. All i need, is that the things the user changes in the menu, is remembered next time the program starts (URL links etc.). What is the best way to do this? And how

  • OCA certification query

    Hi Am planning to do Oracle PLSQL developer certified associate So I would go for IZ0-007 and IZ0-147 certifications Please suggest me the ebooks to prepare and how to register in bangalore....