Multiple buttons, one action

Hello,
Im new to JSP and I have a problem: (im also using struts)
On my JSP page I have 3 buttons, all of which I want to call the same action. But I want to be able to do 1 of 2 things:
Either the action can determine which button was clicked and set the field on the bean accordingly,
OR the bean fields can be set directly from the button click on the JSP.
Thanks,
Conor.

actually... nevermind... I know so....
The real problem with all this is internationalization... If you have different strings for buttons for different languages, you don't really want to check the value in the bean.
Granted, the form should only send the value for the button which was clicked..
So as long as the bean property for that button is not null, it should be good.
Otherwise, you'd need a hidden field and set the value Javascript in the onclick method of the button.

Similar Messages

  • Can multiple button actions be implemented by creating just one RFC?

    Hi All,
         I wanted ask a general question "is it possible to create just one RFC for multiple button actions such as delete, insert, search, modify, copy".
       I tried using one RFC for all the above mentioned actions but I wasn't able to consistently get expected results. So, I just want to confirm from SDN forum members that is it a good practice or is it advisible to create individual RFC for each button actions?
    Earlier responses would be much appreciated.
    Thanks
    Uday

    Hi,
    I did not see any problem for that creation on multiple button actions such as delete, insert, search, modify, copy".  These actions depending up on your RFC.
    For Example. Your RFC having Insert and Delete Functionality you can develop these two Actions. i.e is depending upon your requirement and Depending upon you r RFC functionality. That
    RFC donu2019t gave insert, Delete, modify these functionalities no need to create these Actions.
    So there is no restriction for call the RFC Via Actions(buttons)
    Hope this is help full for u
    Regards
    Vijay

  • How to use one pop up window for multiple buttons and input fields?

    Hi Experts,
    I have created a pop up window that will be opened from multiple buttons in the same view. There are input fields that the data will be populated from a pop up window.  How can I set up which button that a pop up window is opened from? I also would like to populate the data from a pop up window to the input field next to a clicked button. There are 6 buttons and 6 input fields that share the same pop up window. I would very appreciate your responses.
    Thank you,
    Don

    Hi,
    Try creating 2 context attributes, one in your component controller and the other in the pop-up view. Bind the attribute of pop-up view to the component controller attribute.
    In the main view, on click of every button set a unique code in the controller's context which helps you in identifying the button clicked. Since u have created a binding to the pop-up view attribute the value flows from the controller.
    In the init method of your pop-up view, check the value of the attribute and based on that display which ever UI elements are required.
    Eg:
    On Button 1 click set value "B1", Button 2  value "B2" etc. In the init() of pop-up view u can check the values and perform the required operation:
    if(("B1").wdContext().currentContextElement().getButtonIdentifier()){
    else...{
    Hope this helps you.
    Regards,
    Poojith MV

  • How to delete Multiple Artists in one action?

    Hi,
    I want to do a big clean up on an iTunes library with over 4000 albums.
    How can I delete multiple Artists in one action?
    It looks like I can only delete 1 Artist at a time, and then this action shoots me to the top of the list.  Which is a pain then having to scroll back down through such a huge list to then delete the others one at a time... each time being shot back to the top of the list.
    For example I have the following artists;
    The Alarm 01 – 1 song
    The Alarm 02 – 1 song
    The Alarm 03 – 1 song
    The Alarm 04 – 1 song
    The Alarm 05 – 1 song
    The Alarm 06 – 1 song
    And I want to delete them all in 1 action.
    Can this be done?  How best to do it?
    Thanks in advance,
    Dave

    You can't delete "artists" - just songs (or songs grouped into albums).  When iTunes displays the library or a playlist in Artists view it is doing so using the metadata values set in the relevant songs.  If you're looking at this view:
    then your selections in the left pane - the artists list - is filtering what you see on the right.  When you select Delete via the keyboard or via a right-click operation, you are initiating an operation to delete the songs by that artist.  To delete songs by more than one artist in a single operation you'll need to select and delete in Albums view:
    or in Songs view:
    where you can also use the Column Browser to filter songs by multiple artists:

  • Scriptui multiple buttons action

    I want to create a dialog consisting of multiple buttons. As a result I want value which button was pressed by user.
    The script (shortened to problematic part):
    // I'm looping through elements on layer 'warstwa' from kolorStart to kolorStop, 'k' is used for number buttons
                        for (i = kolorStart, k = 0; i <= kolorStop; k++, i++) {
                                  myButton[k] = myButtonGroup.add ("button", undefined, warstwa.pageItems[i].contents);
                                  myButton[k].label = warstwa.pageItems[i].contents;
                                  myButton[k].onClick = function () { wybranyKolor = myButton[k].label; myWindow.close(); }
    The result:
    but buttons don't work, wybranyKolor returning 'undefined'. If I change "wybranyKolor =  myButton[k].label" to "wybranyKolor =  myButton[k-1].label" I get proper answer but it is the same for all buttons so it looks that all buttons have the same acion assigned. How to get each button to has unique name which can be passed to variable?
    Propably I can achive the same with radio buttons' list but with buttons it is one click less for the user.

    sorry I don't understand your new question,
    you need this
    myButton[k].label = warstwa.pageItems[i].contents;
    you don't need this one
    myButton[k].onClick = function () { wybranyKolor = myButton[k].label; myWindow.close(); }
    replace with
    myButton[k].onClick = function () { wybranyKolor = this.label; myWindow.close(); }

  • One button, two actions

    I would like to be able to click on a button one time and
    have it open and play a movie. This movie would be overlayed on the
    layer that the button is on with the button still visible. Then
    after that movie has played, I would like to click on the same
    button again to close the movie so that it no longer appears. Can
    anyone offer any help on how to do that?

    :

  • Calling single action from multiple buttons

    Hi All,
    i want to call a common action assigned to 2 buttons. the action will have a flag. depending on button click i have to execute method with flag as true/false.
    i think i can do this by getting the ID of the button. please let me know is there any method to get the ID of the button clicked or do u have any other solution for this???
    Regards,
    Chandra

    Hi Chandra,
    Just enter "ID type string" as a parameter above to the code of the action.
    Best regards,
    Thomas
    P.S: Another way to solve this problem is to use parameter mapping for events of ui elements.

  • GP: Assigning multiple users on one action

    There is a need to appoint more than one user to one action. If one user is not answered, the process should not proceed to the next step.

    Refer this.
    /people/berndt.woerner/blog/2007/09/19/different-ways-to-model-dynamical-assignment-of-user-to-process-roles-using-composition-tool-guided-procedures--part-1
    If you implement by parallel dynamic block way one action is assigned to multple users with different instances.
    As it is in parallel dynamic block untill all the users did not complete the their own action, process will not move fwd. hemce this will solve your problem.
    Regards,
    Pratik khandelwal
    Edited by: Pratik Khandelwal on May 19, 2009 9:22 AM

  • Notes interaction pauses slide that contains multiple buttons

    I have several slides, each with a Notes Interaction. As advised, each of the notes is set to Rest of Project and are not resized.
    On the slides with a Notes Interaction, there are multiple buttons made out of Smart Objects. When a button is clicked, an advanced action causes a certain text caption to appear.
    The problem is that the buttons work UNTIL the Notes Interaction appears on the slide. As soon as the Notes Interaction appears, the slide seems to be paused and the buttons that are supposed to show text captions no longer work.
    I'm hoping that someone can help with a solution to this.
    By the way, this only seems to happy when previewing in HTML web browser.

    Jay,
    I had replied in an earlier thread that you need to have ONLY ONE notes interaction in the entire project - Not on every slide. The interaction is designed to be placed only once inside a project. So, placing it in the first slide of your project and setting 'Rest of Project' on it should cater to your need.
    You can choose slide notes or project based notes in the edit panel of the interaction.
    Marcellus

  • Changing Font Of Multiple Buttons

    Hey ya'll! First off i'm new here and it looks like you guys
    know what you're talking about. i searched the forums but could not
    find any help (perhaps i wasn't' looking hard enough) ANYWAY here
    is the deal:
    i'm a complete n00b.
    I have a flash movie with multiple buttons and want to change
    the fonts of ALL buttons simultaneously (it changes color on
    mouseover, so i want to change the font of the text which is a
    different color... ... the fla file is here.... i can make any
    changes necessary and start over if need be (its a pretty simple
    flash menu i guess) any help with optimization and efficiency would
    be appreciated.
    thanks in advance
    http://gmoonit.com/matt/flashmenu.swf
    http://gmoonit.com/matt/flashmenu.fla
    http://gmoonit.com/matt/flashmenu.html
    you can send files to [email protected]
    aim: gmoonit
    msn: [email protected]
    yahoo: [email protected]
    meebo: gmoonit

    gmoonit wrote:
    > Hey ya'll! First off i'm new here and it looks like you
    guys know what you're
    > talking about. i searched the forums but could not find
    any help (perhaps i
    > wasn't' looking hard enough) ANYWAY here is the deal:
    > i'm a complete n00b.
    > I have a flash movie with multiple buttons and want to
    change the fonts of ALL
    > buttons simultaneously (it changes color on mouseover,
    so i want to change the
    > font of the text which is a different color... ... the
    fla file is here.... i
    > can make any changes necessary and start over if need be
    (its a pretty simple
    > flash menu i guess) any help with optimization and
    efficiency would be
    > appreciated.
    You need to edit each button individually, one by one.
    The only time when multiple buttons get changed all at once
    is when you
    design it fully dynamic. One button/movie clip, duplicated,
    multiplied and
    control by action script.
    In your case, you need to change one by one manually.
    By the way, take note that the forum is connected to News
    Server. Many of us
    never use the browser based forum so by bumping your post,
    you only make it appear
    answered and your chances of getting help get smaller as we
    usually go for the
    unanswered threads only.
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Multiple buttons on a single slide each connecting to a different url

    Using a trial version of Captivate 7.  I have a handful of slides where the customer wants to open different forms via url.  I tried using a button for each link, inserting the url and using the "enter" key for each of the multiple buttons.  Works fine with the mouse but for 508 folks who tab to the URL and hit the enter key ......... I get many instances where the incorrect url is activated.  Is there a way around this without assicning a different shortcut key for buttons where thare are more than one on a single slide?     Thanks

    Welcome to AD!
    Here is an article on using multiple ipods. I suggest method 1 and steer clear of method 3.
    http://support.apple.com/kb/HT1495
    For your point #1, sharing music on same PC between users, put it in a shared library & set permissions as directed here
    http://support.apple.com/kb/HT1203
    For #2, itunes doesn't have the capability to monitor folders for new content. You'll need to get something like the free program 'itunes folder watch'.

  • How can I create a new keyboard shortcut to toggle load images automatically preferrably with one action?

    I switch the load images automatically selection back and forth in order to save on my 5GB monthly data plan. Is there a utility that would allow me to create a macro of multiple keystrokes to do this with one action? Something like the macro function in Excel? Or is there another way to do this more easily than going to tools, options and clicking on the box? I don't see a shortcut for this item in the standard keyboard shortcuts list

    Hi,
    You could try [https://addons.mozilla.org/en-US/firefox/addon/image-block/?src=search Image Block]. Please also go through the reviews, help and ratings. You can also try to search for similar add-ons via Firefox '''Tools''' ('''Alt''' + '''T''') > '''Add-ons''', Search box on the top right corner, or via the official [https://addons.mozilla.org/ AMO].

  • How to use a back button in action pages?

    Hi all,
    I have created a user login page,home page and user profile page.
    If the user provide correct username and password in the login page he will be taken to home page.
    In the home page he will be having his username and a link to view his profile.
    When the user click on the link "My Profile(user profile)" he wil be taken to that page.
    In my profile page the user can edit only his firstname,lastname and password .
    On the user profile page i have placed a Back Button(using javascript: on onclick event i have used history.back()) to go back to home page after editing his profile.
    If the user edit his profile for n-number of times then atlast if he wants to go back to home page-then he wil cilck the back button.
    Now the problem occurs like the back button not going to home page and it simply going back with the edited history.
    How to use a back button in action pages; without repeating the actions done on the page; how to redirect to the users home page?
    I simply used the hyperlink in userprofile page to go to home page but when i click onit it is displaying blank home page.
    I'm using hibernate orm mapping; cflogin and cflogout tags.
    Any help appreciated,
    Chandru P

    chandrup wrote:
    Hi Dan,
    Dan Bracuk wrote:
    Use an anchor tag.
    I simply used the hyperlink(<a href="home.cfm">Home</a>) in userprofile page to go to home page but when i click onit it is displaying blank home page.
    I can see your problem. You may use javascript:history.go(-1), javascript:history.go(-2), ..., to go back one page, two pages, and so on. But how does one go back an arbitrary n pages? The link href="home.cfm" isn't a good solution for the browser. It makes a new call to the server which, as you may have discovered, can overwrite all the changes made at the browser. 
    You should use the Javascript variable history.length. If you open n links in succession, starting from page0.cfm, then the browser holds the value of history.length as n. So, experiment with something like
    <a href="javascript:history.go(-history.length)">Go home</a>
    or
    <a href="javascript:history.go(-history.length+1)">Go home</a>

  • MVC �Best Practice� (handling multiple views per action/event)

    Looking for the best approach for handling multiple views for one action/event class? Background: I have a small application using a basic MVC model, one controller servlet, multiple event classes, and multiple JSP views. For performance reasons, the controller Servlet is loaded once, and each event class is an instance within it. Each event has an �eventProcess()� and an �eventForward()� method called by the controller, standard stuff.
    However, because event classes should not use instance variables, how should I communicate which view to forward to should based upon eventProcess() logic (e.g. if error, error.jsp, if success, success.sjp)? Currently, there is only one view mapped per event, and I'm having to put error handling logic in the JSP, which goes against the JSP being for just view only.
    My though was 1) A session object/variable that the eventProcess() sets, and the eventForward() reads, or 2) Have eventProcess() return a mapping key and have the conroller lookup a view page based upon that key, as opposed to 1-1 event/view mapping.
    Would like your thoughts!
    Thanks
    bRi

    Your solution seems ok to me, but maybe the Struts framework from Apache
    that implements MVC for JSP is a better solution for you:
    http://jakarta.apache.org/struts/index.html
    You should take a look at it. It has in addition some useful taglibs that makes life much easier.
    We have successfully used it in a project with about 50 pages.

  • How to create multiple buttons in ALV Toolbar in Webdynpro ABAP

    Hi all,
    I am trying to create multiple buttons in Webdynpro  ALV toolbar, please go through the code.
    What happening is, second button is replacing the first one.
    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
       lo_cmp_usage =   wd_this->wd_cpuse_alv_table( ).
       IF lo_cmp_usage->has_active_component( ) IS INITIAL.
         lo_cmp_usage->create_component( ).
       ENDIF.
       DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
       lo_interfacecontroller =   wd_this->wd_cpifc_alv_table( ).
        DATA lv_value TYPE REF TO cl_salv_wd_config_table.
       lv_value = lo_interfacecontroller->get_model(
       DATA lr_buttonui1 TYPE REF TO cl_salv_wd_fe_button.
       DATA lr_buttonui2 TYPE REF TO cl_salv_wd_fe_button.
       DATA button1 TYPE REF TO cl_salv_wd_function.
       DATA button2 TYPE REF TO cl_salv_wd_function.
    **First button
       CREATE OBJECT lr_buttonui1.
       lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
       button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON')."creating the function for alv button
       button1->set_editor( lr_buttonui1 ).
    **Second button
       CREATE OBJECT lr_buttonui2.
         lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
       button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON' )."creating the function for alv button
       button2->set_editor( lr_buttonui2 ).
    How can I overcome this??
    Thanks
    Eshwar

    Hi Eshwar,
    The button Ids are same for both the buttons in your code. You need to change it as BUTTON1, BUTTON2.
    **First button
       CREATE OBJECT lr_buttonui1.
       lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
       button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON1')."creating the function for alv button
       button1->set_editor( lr_buttonui1 ).
    **Second button
       CREATE OBJECT lr_buttonui2.
         lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
       button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON2' )."creating the function for alv button
       button2->set_editor( lr_buttonui2 ).

Maybe you are looking for

  • How do I accept an event that shows up in my iCal inbox?

    When I enter an event into my iCal it shows that there is a message in my iCal inbox.  How can I accept or remove it?

  • MIG : K7 - DDR3 - 1600 MHz - IBIS Model for addr/cmd with VccAux = 2.0V

    Hi everybody ! I have a problem in the generation of my IBIS file... I'm using Vivado 2015.1 and MIG v2.3. My FPGA is xc7k325tffg900-2. In the xdc file (generated by the MIG), I have this type of constraint for all of my address and control signals :

  • Small problem after moving music folder

    I moved my music folder to an external drive and used the consolidate library afterwards. All the music was moved with no problems and I have no exclamation points anywhere. My only problem was I had purchased three iPod games. They are still located

  • How Can I Reset anthy Dictionary (kasumi: invalid entry in romaji)

    I've been using ibus-anthy for a while and then I installed kasumi to add rare words and emoticon shortcuts. Unfortunately I made mistake by entering words in romaji (not in kana) and now I can't launch kasumi. Sound must consist of only Hiragana cha

  • Image swap and restore

    The image swap and restore won't work. I want to have one image switch to another when clicked and then get restored to the original image when clicked again. It lets me click once, but it won't restore the image on another click. I found that when i