Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ActionListener NetBeans

 
martin monowitz
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my newbie problem...

i tried this in NetBeans 6.0:

...
<h:messages style="color: blue"/><br>
<h:commandButton id="button01" value="Click me" action="success">
<f:actionListener type="events.MyListener"/>
</h:commandButton>
...

package events;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;

public class MyListener implements ActionListener {

public MyListener() {
}

public void processAction(ActionEvent ae) throws AbortProcessingException {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("button clicked"));
}

}

My problem: nothing happens :P
no errors, no crash, no exception, ...
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"johnny bravo",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic