This content has been marked as final.
Show 2 replies
-
1. Re: Fire ActionListener from method
leiras Jun 3, 2008 1:45 PM (in response to leiras)Solved. I found a solution:
public class MenuClickEvent implements ActionListener { @Override public void processAction(ActionEvent event) throws AbortProcessingException { HtmlAjaxCommandLink cl = (HtmlAjaxCommandLink)event.getSource(); ItemMenu itemMenu = (ItemMenu) cl.getAttributes().get("itemMenu"); FacesContext fc = FacesContext.getCurrentInstance(); TelaPrincipal telaPrincipal = (TelaPrincipal) fc.getApplication().getVariableResolver().resolveVariable(fc, "telaPrincipal"); telaPrincipal.setMenuAtual(itemMenu.getPai().getTexto()+" > "+itemMenu.getTexto()); } }
HtmlAjaxCommandLink clItemMenu = new HtmlAjaxCommandLink(); clItemMenu.addActionListener(new MenuClickEvent());
Now I can add multiple classes that implement ActionListener. -
2. Re: Fire ActionListener from method
ilya_shaikovsky Jun 4, 2008 4:37 AM (in response to leiras)Another solution is add more than one ActionListener to the same component (HtmlAjaxCommandLink). Is it possible?
use a fewf:actionListener
nested to your component ;)