File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I set actionListeners in code

 
seb petterson
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If in java code of a managed bean I have:

And in the same bean thres a methdo:


What is the java code for setting setSortOrder as an actionListener on the commandLink object?

Thanks.
 
Garann Means
Ranch Hand
Posts: 214
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it's like this..


[ September 19, 2005: Message edited by: Garann Rose Means ]
 
seb petterson
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Garann Rose Means:
I think it's like this..



[ September 19, 2005: Message edited by: Garann Rose Means ]


Thank you, that is what I thought too. But a javax.faces.el.MethodNotFoundException is thrown. It says it can't find the method setSortOrder() in the class. Which is correct since setSortOrder takes an ActionEvent, that is setSortOrder(ActionEvent ae) is defined, but not setSortOrder().

What am I doing wrong, setSortOrder should take an ActionEvent right, since it's an an action listener, right?
 
seb petterson
Ranch Hand
Posts: 118
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, solved it, this is the code that worked:

[ September 20, 2005: Message edited by: seb petterson ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic