Dynamic h:commandLinks : how do I know which one has been clicked?

Imagine I have something like:
<h:dataTable etc etc>
<h:column>
<h:outputText etc etc />
</h:column>
<h:column>
<h:commandLink action="#{BeanName.removeEntry}" />
</h:column>
</h:dataTable>
<h:inputText etc etc><h:commandLink action="#{BeanName.addEntry}" />
so that when I add Entries, they get seen on the dataTable above..
THe addEntry code is easy to do, it's only a ArrayList.add() method call but what about the removeEntry? I don't know how to figure out which 'remove' commandLink was clicked.

If you have a datamodel in yo
ur datatable, then you can do something like this:
getModel().getRowData()
This returns the selected row.
From here it's with you.....

Similar Messages

  • JRadioButtons - how do i know which one has been clicked?!

    hey all,
    im working on a simple gui to implement a ticket office system. im a bit of a newbie to using GUIs and im fed up of trawling through the api's in search of answers and im on the home run... so here's my q...
    i have a gui class for doing a search for tickets. i have a controller in a seperate actionListener class for this gui. i have three radio buttons for searching for three different things and then there's a search jbutton to start the search.
    how do i know what radio button the user has selected when they click search? i need to be able to know this from the controller, not in the gui itself.
    thanks a mil!

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TicketOffice_Demo extends JFrame {
        public TicketOffice_Demo() {
            initComponents();
        private void initComponents() {
            ticketsGroup = new ButtonGroup();
            toolbar = new JToolBar();
            startSearch = new JButton();
            typeA = new JRadioButton();
            typeB = new JRadioButton();
            typeC = new JRadioButton();
            scrollpane = new JScrollPane();
            textarea = new JTextArea();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setTitle("Ticket Office Demo");
            toolbar.setFloatable(false);
            startSearch.setText("Start Search");
            startSearch.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    startSearchActionPerformed(evt);
            toolbar.add(startSearch);
            ticketsGroup.add(typeA);
            typeA.setSelected(true);
            typeA.setText("\"A\" Tickets");
            typeA.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeA);
            ticketsGroup.add(typeB);
            typeB.setText("\"B\" Tickets");
            typeB.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeB);
            ticketsGroup.add(typeC);
            typeC.setText("\"C\" Tickets");
            typeC.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeC);
            getContentPane().add(toolbar, BorderLayout.NORTH);
            textarea.setBackground(new Color(255, 255, 204));
            textarea.setEditable(false);
            scrollpane.setViewportView(textarea);
            getContentPane().add(scrollpane, BorderLayout.CENTER);
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-400)/2, (screenSize.height-300)/2, 400, 300);
        private void startSearchActionPerformed(ActionEvent evt) {
            Controller cont = new Controller(ticketType);
            textarea.append("Controller searches for ticket type '"+cont.getTicketType()+"'\n");
        private void typeAItemStateChanged(ItemEvent evt) {
            if(typeA.isSelected()){
                ticketType = "A";
            }else if(typeB.isSelected()){
                ticketType = "B";
            }else if(typeC.isSelected()){
                ticketType = "C";
        public static void main(String args[]) {
            new TicketOffice_Demo().setVisible(true);
        private JButton startSearch;
        private JRadioButton typeA;
        private JRadioButton typeB;
        private JRadioButton typeC;
        private JScrollPane scrollpane;
        private JTextArea textarea;
        private JToolBar toolbar;
        private ButtonGroup ticketsGroup;
        private String ticketType ="A";
    class Controller {
        Controller(String ticketType){
            this.ticketType = ticketType;
        public String getTicketType(){
            return ticketType;
        private String ticketType;
    }

  • How do I know which block has been changed in Master/Detail

    Hi,
    I have master detail blocks. How do I know which block has been changed?
    I used :SYSTEM.FORM_STATUS. It only gave me "Changed" or "Query". but didn't tell me which block has been changed in MASTER or DETAIL.

    I believe if :system.form_status != 'QUERY' you'll need to loop through through the blocks checking :system.block_status to see who changed. Of course you'd have to go_block() before checking the status.

  • How do I know which workflow has been activated for my SHC in SRM

    Hi Experts ,
    Can anyone tell me where to find which workflow has been activated to my Shopping cart in the SRM. so that it creates a PO in the backend
    To create a PO in the back end it should have a WF actiavted.
    do we can have only always one WF activated or can we have multiple WFs depending on the conditions for one scenario
    Please suggest me
    Regards
    Sairam.

    Cross-Application Basic Settings u2192 SAP Business Workflow u2192 Perform Task-Specific Cusomizing
    SAP u2192 SRM u2192 SRM-EBP u2192 SRM-EBP-WFL
           -   WS10000060 (Automatic approval)
             -   WS10000129 (One-step approval)
             -   WS10000031 (Two-step approval)
             -   WS10000276 (Approval single-level over limit)
             -   WS14000044 (Completion by purchaser)
             -   WS14000109 (Approval n-step over value limit)
             -   WS14500015 (Item approval)
             -   WS14000045 (Delete shopping cart after application error)
             -   WS10000202 (Transfer purchase requisition)
             -   WS10000215 (Resubmission of shopping cart by administrator)
    You need to check Event linkage is either Activated or Deactivated aor these above work flow . I fit is activated it shows green light.
    Muthu
    Edited by: muthuraman on Jul 29, 2008 2:38 PM

  • How  can i determin which tab has been clicked??

    hi there
    how do i determine which one of the tabs in a tabbedPane has been clicked? do i add ActionListener to the tabbedPane or its sub JPanel?

    I import them all, it finallly compiled, but I am not sure if they are ok. here is the codes
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    TabbedPane = new JTabbedPane();
    TabbedPane.addTab("Easy", easyTab);
    TabbedPane.addChangeListener(new ChangeListener()
    public void stateChanged( ChangeEvent ce )
    Object source = ce.getSource();
    if (source == "Easy")
    currentTab = "easy";
    does it look all right to you?

  • DataTable with commandLinks  - How do I know which one I clicked?

    So, imagine I have a dataTable which returns rows from my database (any SELECT * FROM TABLE) and I want to, for example, delete the one object from row N, how do I know, if I put <h:commandLinks> after each row, which row I clicked?
    It's been really hard to do such a simple thing in JSF for me. Help!

    You'd better use selectBooleanCheckbox to delete the selected row rather than sommandLink. This way you'll be able to select more than one row and to delete all selected rows at the same time.
    Hope this helps!
    Ragards,
    Mariana Getova

  • Adobe Cloud has 2 different Muse programs.... how do I know which one is the newer better version?

    So I am new to Muse, and my Adobe Cloud has 2 different programs from Muse... how do I know which one is the newer better version?
    One Must program (Muse CC 2014.2)  has a black background when working on it... it looks like other Adobe programs such as Photoshop.
    The other one is light color (Muse CC) very similar to the black color Muse on functions.....
    One of the difference I notice is that the light color Muse has a few widgets in the library, while the black background Muse seems to have an empty library
    So... why are there 2 different Muse programs in my Adobe Cloud?

    Hi
    The latest version of Muse is 2014.2, so you need to uninstall another version of Muse manually.
    regarding the items in Library, you can add items in your library manually, as shown in this article
    Adobe Muse Help | Organizing and reusing design elements using Library panel
    Please let me know if you have any other query.

  • HT1451 If I have two iTunes libraries on one computer, how do I know which one is opening when I click on the iTunes icon on the desktop?

    If I have two or more iTunes Libraries on one computer, how do I know which one is opening when I click on the iTunes icon on my desktop?

    You cannot.
    When you sync to a new library, it will erase the current content.
    Use your backup copy of the old computer to copy everything to the new one.

  • Can you have multiple Apple TV's in the same house and network? If so how do you know which one to pick from your Idevice?

    can you have multiple Apple TV's in the same house and network? If so how do you know which one to pick from your Idevice?

    Yes, there are even defaults for naming them, such as LivingRoom, Bedroom, etc, or you can even enter your own name with the remote for each AppleTV.

  • I recently deleted many duplicate files. In the midst of it my Itunes songs are not in Itunes. They are in two different folders. One under 'Music' in my ID. And two under a MyMusic file in Documents. How do I know which one to import?

    I recently deleted many duplicate files. In the midst of it my Itunes songs are not in Itunes. They are in two different folders. One under 'Music' in my ID. And two under a MyMusic file in Documents. How do I know which one to import?

    Thanks, this is not an ideal answer but probably the most sensible one in my case.
    I will try it unless someone has a better suggestion, but I'll wait a bit as it will take me a few days anyway (I had actually tried to create a new smaller playlist or download by album, but at this stage the music app is not letting me queue a list of songs for download - I think I will have to disable and re-enable iTunes match which will probably delete all the songs).
    I have to say I am not very impressed with Apple here - having an online backup of all your data and beeing able to restore it to a new device easily was a strong selling point of iCloud. For music, they are Definitly not delivering at the stage.

  • Hi I wonder if I live in Bangkok and like to have my own website who should I use for hosting so many of them and how do I know which one is a good one thank you

    Hi I wonder if I live in Bangkok and like to have my own website whshah old I use as hosting website? so many of them and how do I know which one is a good one thank you

    It doesn't really matter which country your hosting service is located in so long as they offer 24/7 tech support in your chosen language. Telephone support is usually free of charge to you.
    Some info about the essential features to look for...
    http://www.iwebformusicians.com/iWeb/Website-Hosting.html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • Difference between photoshop cc and photoshop cc 2014   how do i know which one I am using?

    difference between photoshop cc and photoshop cc 2014   how do i know which one I am using?

    Hi Petereas,
    Both are different version of Photoshop application.
    In Photoshop CC 2014 there are several new feature introduced than CC.
    Please refer the following page on whats new in Photoshop 2014.
    Photoshop Help | New features summary
    When you go to Help>About Photoshop then Photoshop 2014 shows version 2014.0.0 Release.
    Hope this helps.
    Thanks and Regards,
    Sumit Singh

  • HT201744 How do you actually know where a Spotlight file is?  I mean all well and good Spotlight identifies it but I want to know which file has been identified and where it is......

    How do you actually know where a Spotlight file is?  I mean all well and good Spotlight identifies it but I want to know which file has been identified and where it is......

    To know where the Spotlight file is, highlight it in Spotlight and hold the Command key, so you will see its location at the bottom of the window

  • How do I know which commands have been pushed to switch by PI CLI template

    We have PI version 1.3. I tried to deploy the built-in CLI template "vlan" just to create a vlan. I run the template and input vlan ID and name. The job is shown as successful in PI but the vlan is not created on the switch. In the transcript part of the job history, it only shows "configlet:response: config t". Please see the attachment for the screen shot. How do I know which commands have been pushed to the switch by the CLI template? How does PI push the CLI template to the switch? via snmp or telnet? I tried to run "debug tacacs authentication" and "debug tacacs accounting" on the switch because the switch is configured for command authentication and command accounting but I don't see any commands in the debug. It looks PI did not push any commands to the switch. Please help me to troubleshoot this.
    Thanks.

    The MPEG 2 Playback Component required by Streamclip is an optional purchase.
    http://store.apple.com/us/product/D2187Z/A
    There are other converters that can handle MPEG-2 files; try Handbrake.
    Regards.

  • HT2622 My Mac Mini serial # is C0*******JD0. The internal power supply burned. How do I know which one to buy?  A1347?

    My Mac Mini serial # is C0******JD0. The internal power supply burned. How do I know which one to buy?  A1347?
    <Edited by Host>

    Also, this company may be able to help you identify the item from their database and your serial number.
    http://www.powerbookmedic.com

Maybe you are looking for

  • File format drop down menu does not appear in the export dialogue box

    I am trying to export a book project as individual jpeg files and I can't see the drop down menu to choose what file format I want to export the file as. All I can do is export it as a .pdf which does not help me.

  • C7280 photosmart won't print red

    My HP Photosmart C7280 All in one has decided not to print red!  Already ran clean print head routine, changed cartridges.  Any suggestions? 

  • Images not showing up on facebook and browser pages?

    not showing any images and other website when browsing the web

  • Preview RAW & NTSC 16:9??

    I'm cutting a film that is ProRes 422 NTSC anamorphic. I worked on it this fall. I have this memory of displaying the image on a second monitor in Preview RAW and getting the 16:9 frame ... (small in the frame, given it's NTSC 720 X 486, but 16:9 non

  • Netstat reveals connections that I don't understand

    I periodically run Netstat when my cable connections seems to slow. Recently I've been seeing a lot of connections marked "established" or "listen" that worry me. How can I find out what these are? Could they be accessing my computer? Security issue?