Action Event

Hi,
Slight problem with an action event, have a workaround but want to make sure there isnt another way!
Basically I have 2 combo boxes, Make and Model. When an item is selected in one of them the following happens:
Gets the value selected, runs a query on a data base, clears the other combobox, and inserts the data returned in the other combo box.
The problem is that clearing the other combobox registers as an actionPerformed on that box, and so does adding the data to that box.
Can I consume that event?? i.e. make the latter 2 actions not register as events???
I have worked around it using a boolean, but am looking for another way.
I dont have the code off hand to show it!!
Thanks
Ciara

I have worked around it using a boolean, but am looking for another way.If the MakeActionListener fiddle-diddles with the Model, it's the first ones responsibility
that the second one doesn't get spurious events fired towards its general direction. A boolean, as
you describe, solves the problem but then its the ModelActionListener that's got to check it.
Would it be possible that the MakeActionListener temporarily removes the other listener from
the notification list and re-install it after it has performed its dirty deeds?
kind regards,
Jos

Similar Messages

  • How to set fire action event for particular rows in a table

    HI All,
    I have a requirement in which I want to set fire action event for particular rows in a table based on some condition.
    The table has columns like fullname,employee id etc.
    So i want to set fire action event for particulars rows only which will saisfy some condition.

    Atanu,
    Your approach(setting fire action for few rows) seems not possible. Better to go ahead with workaround.
    Do you want this functionality in processRequest(while page loading) or processFromRequest(on some event) method ? Give more explanation regd. your requirement ?
    In either case loop through the rows and when your condition is met write the action to be performed in controller.
    Regards,
    Anand

  • 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.

  • h:CommandLink : Action event not called on the first click

    Hi,
    I am facing a problem here.
    I have a JSF page:
    When I first load the page, I have few text boxes and dropdowns. With out doing anything If I click the <h:commandLink I call an action in my pagecode.
    But the problem is on the very first load of the page, without doing anything if I click on the command link action event in my pagecode is not called, but If I click on the link the second timethe pagecode actionevent is called.
    So I think tried submitting the form in the JSF page onclik of the commandlink it works in my Local IBM RAD. But doesnot work in the WebSphere Portal.
    So can you tell me if I can submit the form atleast once when the page loads for the first time
    This is my command link:
    <tr>
    <td colspan="2" align="center">
    <h:commandLink styleClass="commandLink" id="lnkBtnCreateUser" action="#{pc_Createuser.doLnkBtnCreateUserAction}">
    <hx:graphicImageEx styleClass="graphicImageEx" id="imgBtnCreateUser" value="/theme/images/btnCreateUser.gif" style="border:0;cursor:pointer" onclick="return onFormSubmit();"></hx:graphicImageEx>
    </h:commandLink>
    </td>
    </tr>
    function onFormSubmit(){
    //enabling all the disable components
    So can anybody please help me on this. Why exactly the pageCode action event is not called for the very first click ???

    seems that a prependID="false" attribute in the respective form was causing the trouble. At least it's working now that I've deleted it.
    I introduced it, because last time the component ID's messed up the output of the error/success messages ("j_id:xxx isn't that of a usefull information to the enduser).
    Edited by: stger on Apr 9, 2008 5:41 PM

  • Problem with action events........ :(

    hi all,
    there is a strange problem which me and my colleagues are facing now-a-days......
    For some odd and unknown reason, the links on the page suddenly stops woking... it goes like this....
    we write events (buttons or action links) .... we test them and they are working fine...... than we write some other piece of code and than run the program and links work no more... The program never goes in the action event for the component...... and surprisingly it also dont show an error.... It just keeps on refreshing itself again and again....... (this thing is also verified by using debugger that actions events just stop being called....) it happens for random situations ...... Once i thought that maybe its has to do something with beforeRenderResponse() method... but it happens even in beans without beforeRenderResponse() method.....
    Can anyone tell me whats going on around here???? we are extremely confused here with dead lines approaching fast........
    regards

    I've had this same problem....links were working fine yesterday. I added more functionality which didn't even affect the links, and now they're not working. Unfortunately, I don't have a solution either.
    Has anybody been able to access the logging in the facescontext or application to see what the lifecycle is doing before it stops???

  • Please help me with some action event buttons

    {color:#ff6600}i am trying to figure out how to capture two values from an action event button. i have already tried it 6 times and i cant figure it out.
    Its a simple calculator with numbers 1 and 2 and does a multiplication calculation.
    Can you help me figure it out it will be really helpful.
    {color}
    import javax.swing.*;
    import java.util.*;
    import java.awt.event.*;
    public class Calculator implements ActionListener {
    JFrame frame;
    JPanel contentpane;
    JButton one,two;
    JTextField field;
    JButton mult;
    JButton adds;
    JButton equals;
    JButton go;
    public Calculator() {
    frame = new JFrame ("Calculator" );
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    contentpane = new JPanel();
    contentpane.setBorder(BorderFactory.createEmptyBorder(20,20,40,40));
    one = new JButton( Integer.toString(1));
    one.setActionCommand(Integer.toString(1));
    one.addActionListener(this);
    contentpane.add(one);
    two = new JButton(Integer.toString(2));
    two.setActionCommand(Integer.toString(2));
    two.addActionListener(this);
    contentpane.add(two);
    field = new JTextField(10 );
    contentpane.add(field);
    go = new JButton("calculate");
    go.setActionCommand("go");
    go.addActionListener(this);
    contentpane.add(go);
    mult = new JButton( "*");
    mult.setActionCommand("mult");
    mult.addActionListener(this);
    contentpane.add(mult);
    adds = new JButton( "+");
    adds.setActionCommand("add");
    contentpane.add(adds);
    frame.setContentPane(contentpane);
    frame.pack();
    frame.setVisible(true);
    public void actionPerformed (ActionEvent event ) {
    String eventn = event.getActionCommand();
    String text = field.getText();
    String mult ="*";
    {color:#800080}if (eventn.equals("1")||eventn.equals("2") ){  \\ *{color:#ff6600}i dont know how to store two different value from an action event{color}*
    text+=eventn ;
    int num = Integer.parseInt(text);
    field.setText(text);
    {color}
    {color:#800080}if (eventn.equalsIgnoreCase("mult")){
    field.setText("");
    {color}
    {color:#800080}};
    {color}
    public static void runGui(){
    JFrame.setDefaultLookAndFeelDecorated(true);
    Calculator r = new Calculator();
    public static void main (String[]args){
    javax.swing.SwingUtilities.invokeLater(new Runnable(){
    public void run(){
    runGui();

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ListenerDemo {
        private class DigitListener implements ActionListener {
           private int digit;
           public DigitListener(int digit) {
               this.digit = digit;
           public void actionPerformed(ActionEvent evt) {
                JOptionPane.showMessageDialog(f, "You pressed " + digit);
        private JFrame f = new JFrame();
        private JButton button1 = new JButton("1");
        private JButton button2 = new JButton("2");
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable(){
                public void run() {
                    new ListenerDemo().go();
        void go() {
            button1.addActionListener(new DigitListener(1));
            button2.addActionListener(new DigitListener(2));
            JPanel cp = new JPanel();
            cp.add(button1);
            cp.add(button2);
            f.setContentPane(cp);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }

  • How do I retain Jbutton text for action event & set img icon on Jbutton

    I need to retain the text on my button as I use this to identify the action event in actionPerformed method when the button is pressed.
    Hoe do I add an image icon to the Jbutton without effecting this?
    [/b]
    class CalcPanel extends JPanel
        implements ActionListener, CurrencyVals
    //currency panel data members
        JButton[] cb = new JButton[4];
    JPanel cbkeys = new JPanel(new GridLayout(4,1));
    //Toolkit tk = Toolkit.getDefaultToolkit();
        //Image img = tk.getImage("D:/temp/ausflag.jpg");
    public CalcPanel(){
    ImageIcon b = new ImageIcon("D:/temp/ausflag.jpg","AUS");
        cb[AUS]= new JButton(b);  //cb[AUS]= new JButton("AUS");
          cbkeys.add(cb[AUS]);
          cb[AUS].addActionListener(this);
    setLayout(new BorderLayout());
        add(display, BorderLayout.NORTH);
        add(keys, BorderLayout.CENTER);
        add(cbkeys, BorderLayout.EAST);
        add(label, BorderLayout.SOUTH);
        public void actionPerformed(ActionEvent evt){
          Object source = evt.getSource();
          int id;
          if (keyBoard) {
            if (source instanceof JButton) {
              String s = ((JButton)source).getText();
    [/b]Regards
    Synfield

    if(keyBoard) { ??! [/b]... do have cause to feel flattered?
    Copy and paste this and save a small eg;- 25px high x 50px wide Jpeg image in the same file and call it "new.jpg", then study it, this posted program (again?) to see where your code went astray.
    THEN, figure out what you want to do with your code ...keep at it!
    Sue x
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ButtonIcon extends JFrame implements ActionListener {
    String []str ={"abc","def","ghi","jkl","mno","pqr","st","uvw"};
    JButton b[] = new JButton[str.length];
       JButton on = new JButton("ON");
       JButton off = new JButton("OFF");
       JButton picture;
       JPanel panel;
       String str2="";
       Font font = new Font("Comic Sans MS" ,0, 14);
       boolean keyBoard;
       ImageIcon icon = new ImageIcon("new.jpg");
    public ButtonIcon(){
       Container c = getContentPane();
       panel = new JPanel();
       panel.setLayout(new FlowLayout());
       picture = new JButton(icon);
       for (int j=0; j<=str.length-1; j++){
             b[j]= new JButton(str[j]);
             b[j].setFont(font);
             panel.add(b[j]);
             b[j].addActionListener(this);
       on.addActionListener(this);
       off.addActionListener(this);
       panel.add(on);
       panel.add(off);
       panel.add(picture);
       c.add(panel);
       public void paint (Graphics g) {
          super.paint (g);
          Graphics2D G = (Graphics2D) g;
          G.setColor(Color.red);
          G.setFont(font);
          G.drawString(str2, 25, 150);
    public void actionPerformed(ActionEvent evt){
        String command = evt.getActionCommand();
        if (keyBoard) {
           if (evt.getSource() instanceof JButton ) {
               str2 += command;
           if (evt.getActionCommand().equals("OFF")) str2 = "";
        if(command.equals("ON")) keyBoard = true;
        if(command.equals("OFF")) keyBoard = false;
    repaint();
    public static void main (String []args){
       ButtonIcon boo = new ButtonIcon();
       boo.setSize(300,200);
       boo.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
       boo.setVisible(true);

  • ********  Need to add any button activated ACTION EVENT***********

    Can anyone help me add any type of ACTION EVENT /ACTION LISTENER TO THIS CODE
    PLEASE REVIEW AND COMPILE IF NECESSARY. Ensure that it compiles without errors. Currently it compiles without errors. It opens up as a GUI window that accepts a password. If anyone could just add a button to it that will do just about anything, time check, date check whatever it would be great!!!!! THIS WAS COMPILED WITH THE JGRASP COMPILER JAVA ACCEPTED
    Thank you all,
    ********************** Bruce's Code*****************************
    import java.awt.*;
    public class TimeEntryForm extends Panel
    private Panel tallPanel = new Panel();
    private Panel tallPanel2= new Panel();
    public TimeEntryForm()
    tallPanel.setLayout(new GridLayout(3, 1));
    tallPanel.add(new Label("Hrs Total"));
    tallPanel.add(new Label("Any"));
    tallPanel.add(new Label("One"));
    tallPanel2.setLayout(new GridLayout(3,1));
    tallPanel2.add(new Label("Personal Leave "));
    tallPanel2.add(new Label("Hrs Total "));
    tallPanel2.add(new Label("Pay Calc "));
    setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = 0; c.gridy = 2;
    add(new Label("Social Security # "), c);
    c.gridx = 1; c.gridy = 0;
    add(new Label("TIME ENTRY FORM"), c);
    c.gridx = 1;c.gridy = 1;
    add(new Label("Enter Date Here "), c);
    c.gridx = 3;c.gridy = 2;
    add(new Label("Employee Name "), c);
    c.gridx = 3;c.gridy = 4;
    add(new Label("Sick Time "), c);
    c.gridx = 0; c.gridy = 3;
    add(new Label("IN OUT "), c);
    c.gridx = 0; c.gridy = 4;
    add(new Label("IN OUT "), c);
    c.gridx = 0; c.gridy = 5;
    add(new Label("IN OUT "), c);
    c.gridx = 0; c.gridy = 6;
    add(new Label("IN OUT "), c);
    c.gridx = 0; c.gridy = 7;
    add(new Label("IN OUT "), c);
    c.gridx = 0; c.gridy = 8;
    add(new Label("IN OUT "), c);
    c.gridx = 0; c.gridy = 9;
    add(tallPanel2, c);
    c.gridx = 1;c.gridy = 11; //note, sets y
    add(new Label("Hrs Worked Today "), c);
    c.gridx = 1;c.gridy = 12;
    add(new Label("Pay Earned Today "), c);
    c.gridx = 2;
    add(tallPanel2, c);
    public static void main(String args[])
    Frame f = new Frame("Time Entry Form");
    f.add(new TimeEntryForm());
    f.pack();
    f.setVisible(true);
    }

    Hi java-luv,
    I am not sure if I understand the problem. But I was able to add a JButton to your code (using the JBuilder designer). The button just exists the application. Please check the listing below. Hope this helps.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class TimeEntryForm extends Panel
    private Panel tallPanel = new Panel();
    private Panel tallPanel2 = new Panel();
    private JButton jButton1 = new JButton();
    public TimeEntryForm() {
    tallPanel.setLayout(new GridLayout(3, 1));
    tallPanel.add(new Label("Hrs Total"));
    tallPanel.add(new Label("Any"));
    tallPanel.add(new Label("One"));
    tallPanel2.setLayout(new GridLayout(3, 1));
    tallPanel2.add(new Label("Personal Leave "));
    tallPanel2.add(new Label("Hrs Total "));
    tallPanel2.add(new Label("Pay Calc "));
    setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = 0;
    c.gridy = 2;
    add(new Label("Social Security # "), c);
    c.gridx = 1;
    c.gridy = 0;
    add(new Label("TIME ENTRY FORM"), c);
    c.gridx = 1;
    c.gridy = 1;
    add(new Label("Enter Date Here "), c);
    c.gridx = 3;
    c.gridy = 2;
    add(new Label("Employee Name "), c);
    c.gridx = 3;
    c.gridy = 4;
    add(new Label("Sick Time "), c);
    c.gridx = 0;
    c.gridy = 3;
    add(new Label("IN OUT "), c);
    c.gridx = 0;
    c.gridy = 4;
    add(new Label("IN OUT "), c);
    c.gridx = 0;
    c.gridy = 5;
    add(new Label("IN OUT "), c);
    c.gridx = 0;
    c.gridy = 6;
    add(new Label("IN OUT "), c);
    c.gridx = 0;
    c.gridy = 7;
    add(new Label("IN OUT "), c);
    c.gridx = 0;
    c.gridy = 8;
    add(new Label("IN OUT "), c);
    c.gridx = 0;
    c.gridy = 9;
    add(tallPanel2, c);
    c.gridx = 1;
    c.gridy = 11; //note, sets y
    add(new Label("Hrs Worked Today "), c);
    c.gridx = 1;
    c.gridy = 12;
    add(new Label("Pay Earned Today "), c);
    c.gridx = 2;
    add(tallPanel2, c);
    jbInit();
    public static void main(String args[]) {
    Frame f = new Frame("Time Entry Form");
    f.add(new TimeEntryForm());
    f.pack();
    f.setVisible(true);
    private void jbInit() {
    jButton1.setText("Exit");
    jButton1.addActionListener(new TimeEntryForm_jButton1_actionAdapter(this));
    this.add(jButton1, null);
    void jButton1_actionPerformed(ActionEvent e) {
    System.exit(0);
    class TimeEntryForm_jButton1_actionAdapter implements java.awt.event.ActionListener {
    TimeEntryForm adaptee;
    TimeEntryForm_jButton1_actionAdapter(TimeEntryForm adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.jButton1_actionPerformed(e);

  • Using a method of a class within an action event

    Good day.
    A beginner question.
    It is possible to use within an action event (triggered by a view of the button)
    instantiate a class from another java project and use a method?
    If it is possible how to do?
    Thank you

    hi carlos,
    yes it is possible. as a reference please have a look at this document How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3
    basically the steps are the same (adding dependency, public parts, etc.) for a ejb or java project.
    regards,
    christian

  • Adding action events

    Whenever i used to add action event, i used to do it like:
    submitJButton.addActionListener(
             new ActionListener() // anonymous inner class
                // event handler called when startJButton is pressed
                public void actionPerformed( ActionEvent event1 )
                   submitJButtonActionPerformed( event1 );
             } // end anonymous inner class
          ); // end call to addActionListenerHow can i add action events to these two buttons though?
        private JPanel createButtonPanel() {
              JPanel panel = new JPanel();
              JPanel temp = new JPanel(new GridLayout(1,2, 5,5));
              temp.add(new JButton("REGISTER"), BorderLayout.LINE_START);
              temp.setPreferredSize(new Dimension(200, 40));
              temp.add(new JButton("LOGIN"), BorderLayout.LINE_END);
              temp.setPreferredSize(new Dimension(200, 40));
              panel.add(temp);
              return panel;
         }

    That works really well. Now for the register button, how would i get this register class to display?
    package layout;
    import javax.swing.*;
    import java.awt.*;
    public class Register {
        private static void createAndShowGUI() {
         String[] labels = {"Name: ", "ID No: ", "Username: ", "Password: "};
         int numPairs = labels.length;
        JPanel pan = new JPanel(new SpringLayout());
        for (int i = 0; i < numPairs; i++) {
            JLabel lab = new JLabel(labels, JLabel.TRAILING);
    pan.add(lab);
    JTextField textField = new JTextField(10);
    lab.setLabelFor(textField);
    pan.add(textField);
    SpringUtilities.makeCompactGrid(pan, numPairs, 2, 6, 6, 6, 6); //(rows, columns, initx, inity, xpad, ypad
         JFrame frame = new JFrame("Nerkesa Pignatelli");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         pan.setOpaque(true);
         frame.setContentPane(pan);
         //Display the window.
         frame.pack();
         frame.setVisible(true);
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    }The only reason i ask this is because i followed the sun tutorial site to produce this register form and when it run's it,, it uses createAndShowGUI(); where when i have added different classes to action events before, i have normally used somthing like in my title class, new Title().setVisible(true);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Action event automatically triggered for combo box

    Hi all,
    I am facing a typical event handling problem for combo box in Swing(Using Net Beans 5.0, jdk 1.4.2)
    While adding items to combo box it is firing action event twice instead of once irrespective of no. of items added to it.
    For eg if there are 1 or more than 1 item added to combo box it is triggerring action event twice(one just after when first item is added and one again when rest all items are added)
    and if there is no item then also it is triggering once.
    Can you please help me out.
    Thanks

    post the SSCCE code, then only it is easy to find the problem

  • JComboBox Action Event problems

    I have a complex UI with which I am having action event issues. Basically, the panel displays info about an object, which can be selected from within the panel through a button/popup window mechanism. A JComboBox (#1) selection determines the contents of another JComboBox (#2) on the same panel. Currently an ActionEvent fires when the user makes a selection using #1 that updates #2. This fuctions correctly with repeated testing so long as a new object is not selected.
    When a new object is selected from within this panel this ActionEvent no longer fires. JComboBox #1 will be updated correctly and #2 will reflect the initial selection in #1, but user selections in #1 will not fire the ActionEvent and thus #2 is never updated.
    Any help is appreciated. I feel like I'm missing something basic here, but I've stared at it for long enough...

    By the way, the workaround is to use the ItemListener as the ItemStateChanged Event is fired reliably.

  • Button action event not call in dataprovider

    hi,
    i have JSF table and it's bound to Mysql database table. when i bound the table and run it's working properly but it's button action event is not call action. when i use static jsf table then it's table action event work properly.
    my jsp code is
    <ui:table binding="#{search.search_table}" id="search_table" lite="true" selectMultipleButton="true" sortPanelToggleButton="true"
                                style="height: 70px; left: 240px; top: 240px; position: absolute; width: 600px" title="Search Text :" visible="true" width="600">
                                <ui:tableRowGroup binding="#{search.tableRowGroup1}" id="tableRowGroup1" rows="5" sourceData="#{search.srch_tablevalDataProvider1}" sourceVar="currentRow">
                                    <!--    <ui:tableColumn headerText="Script" id="tableColumn2" width="700">
                                        <ui:staticText id="staticText4" text="#{currentRow.value['search_script']}"/>
                                    </ui:tableColumn>-->
                                    <ui:tableColumn binding="#{search.tableColumn13}" headerText="Search Word" id="tableColumn13" style="#{search.columnStyle}">
                                        <ui:staticText binding="#{search.search_word1}" id="search_word1" text="#{search.search_word1}"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{search.tableColumn4}" headerText="#{search_lang['search.contentName']}" height="39" id="tableColumn4"
                                        style="#{search.columnStyle}" width="100">
                                        <ui:staticText id="staticText1" onMouseOver="play_video(this);" text="#{currentRow.value['name']}"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{search.tableColumn6}" headerText="#{search_lang['search.srchTag']}" id="tableColumn6"
                                        sort="search_tags" style="#{search.columnStyle}">
                                        <ui:staticText id="staticText3" text="#{currentRow.value['search_tags']}"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{search.tableColumn5}" headerText="#{search_lang['search.tpDetail']}" id="tableColumn5" style="#{search.columnStyle}">
                                        <ui:imageHyperlink action="#{search.action}" id="imageHyperlink1" text="#{currentRow.value['details']}"/>
                                        <ui:button action="#{search.button2_action}" id="button2" text="Button"/>
                                    </ui:tableColumn>
                                </ui:tableRowGroup>
                             </ui:table>and back bean code is
    public String button2_action() {
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            System.out.println("Invoke");
            return null;
        }i don't know what is problem there if found any solution, help me.

    You need to make sure that the getter of the datatable value returns exactly the same list in the apply request values phase of the form submit as it did during the render response phase of the initial display. Only this way JSF can find out which action which row was been invoked. Alternatively you can also place the data bean in session scope (which may have more impact), or use for example Tomahawk's t:dataTable with preserveDataModel attribute set to "true".

  • Action event of combobox

    Hi all..
    I have three combo boxes.
    the second combobox values are loaded when a element from first combobox is chosen.
    the third combobox values are loaded when a element from second combobox is chosen.
    it works fine the first time.
    but when i rechoose an element from the first combobox, the action event for the second combobox is fired without me clicking the second combobox and hence throws an null pointer exception.
    i have the functions written according to the action events.
    should i use any things with respect to the mouse click or something??

    Hi again..
    i used itemListener as u suggested but still face problem..
    the third combo box is not getting loaded.. ie the loadcurrent() is not getting called.
    below is the code..
    public void itemStateChanged(ItemEvent ie)
              Object source=ie.getItemSelectable();
              if(source==tname)
                   System.out.println("combo tname");
                   loadstd();
              else if(source==stdfile)
                   System.out.println("combo stdfile");
                   loadcurrent();
              else if(source==curfile)
                   System.out.println("combo curfile");
         }

  • Missing Action Event from Custom Component

    Hi JSF Gurus,
    I have two custom components, both extends UICommand and have their
    own renderers. I use them on two seperate pages, say component1 on
    page1 and component2 on page2. And page2 is include inside page2.
    I registered an action listener on component2. When the composite page
    is rendered, I clicked on component2. However, the registered action
    listener was not invoked. Inside the debugging (I'm using IntelliJ
    IDEA 5.0) I set a breakpoint inside the decode method of Renderer2
    (renderer for component2). I do see the componen2 actually as an
    actionLister method binding being set to correct value. I do queue the
    new action event to component2 at the end of the decode method. But
    the action listerner never invoke.
    Any idea what did I miss?
    Thanks,
    Edmond

    Hi Yuki,
    Yeah, after I turn on detail JSF debugging as instructed by the book Core JavaServer Faces, I figured out I had a validation error. That solves the mystery.
    Thanks,
    Edmond

Maybe you are looking for