Hi friends, I'm facing a strange problem in jsf. First time only one commandButton is shown in my page. When i click that commandButton, one flag is set and it shows another commandButton(second). But after that, when i click the second commandButton even decode method is not getting called and the action method defined below(doAction) is not getting invoked. Is it a problem in JSF framework itself?
Do you have the doAction method defined in your Demo.java bean??
Joined: Oct 12, 2006
Hi, Ya, I have the doAction() method declared properly.
Joined: Jun 11, 2002
that's odd because I just got it working perfectly here. Can you please then post your entire jsp file as well as your entire bean. Also make sure that the bean is declared in the jsf config xml file, and that that xml config file is referenced in your web.xml.
Actually, the <c:if> statement will not work either. I'm going to assume that your backing bean is Request scoped. If you want this to work, you need to change the scope to Session. If the scope is request, when you use the rendered action button, JSF rebuilds the model and does not know that demo.flag should be true, so the action button is not created in the model and hence is not fired. If you change the scope to session, it will work.