0

How have to call action and actionListner from two different bean and i have added below code

<a4j:commandButton  id="editAlarm"  immediate="false" execute="@this" actionListener="#{cfsBean.updateCfsGroupFeature(itemsComp,tableIndex.index)}"
                                                    action="#{addFeaturePopUpBean.updateCfsGroupFeature(itemsComp,tableIndex.index)}" >

and Bean have this code

public String updateCfsGroupFeature(ActionEvent event,CompositeCharGroupVo value, Integer row) {
}

But i am getting

javax.el.MethodNotFoundException' when invoking action listener '#{cfsBean.updateCfsGroupFeature(itemsComp,tableIndex.index)}' for component 'editAlarm'

Now Differences between action and actionListener @Baluc mentioned we can pass argument in actionListner as well

<h:commandXxx ... actionListener="#{bean.methodWithOneArgument(arg1)}" />
<h:commandXxx ... actionListener="#{bean.methodWithTwoArguments(arg1, arg2)}" />
Community
  • 1
  • 1
Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
  • 1
    Did you read the method name in example? It says two arguments, not three. The exception clearly confirms this. The desired method could not be found. The actual method has one argument too much. – BalusC Aug 18 '15 at 11:53
  • Thanks Got your point – Subodh Joshi Aug 18 '15 at 12:01
  • 2
    In the meanwhile, I improved that answer to eliminate confusion by starters as to method signatures when they don't read the answer's text, but only the code :) – BalusC Aug 18 '15 at 12:03
  • Yes saw that..Its possible to not to call `action` if some condition fail in `actionListener` and both call for different bean? – Subodh Joshi Aug 18 '15 at 12:06
  • 1
    Scroll to bottom of answer and read last section. – BalusC Aug 18 '15 at 12:07
  • @BalusC Beginners often read only the code. The basics JSF are working fine without any background skills. I just started with 'learning by doing'. But to be good at JSF, that is the wrong attempt. I really fell down with this. :) – alexander Aug 19 '15 at 09:21

0 Answers0