0

I have got the following issue. I'm using a4j:button but invokes action only when I click it for the first time. My jsp structure is like the following :

    <h:form id="form">
      ...
      <a4j:commandButton id="cmdButt"
            action="#{AdvertBean.clear}"
            reRender="form"
    </h:form>

And I'm invoking action from javascript through jquery click(). I know that there are also some similiar issues which was described here but all of them are applied to jsf 2 + version. Can anybody help me finding what is wrong ? The second time when i click the button javascript invoke click on cmdButt but it does not invoke action

EDITED:

I see where lays the problem but I still dont understand why. It is because snipper above is in jsp file which is included(imported) dynamically via c:import. If i try to include it via include then it works. Is it possibile to still include this page dynamically and make it work ?

Artur Skrzydło
  • 1,135
  • 18
  • 37
  • In case when form cover all page, you can try to remove `reRender` attribute in `a4j:commandButton` and return the same page outcome in action (button will work like regular `h:commandButton`), or simply use `h:commandButton` – Vasil Lukach Feb 01 '16 at 22:13
  • form is only a part of the page. and i would like to not reload whole page, this is why i'm using a4j:button. but it seems that it doesnt work with dynamically included page (the same code one page included statically works fine) – Artur Skrzydło Feb 02 '16 at 06:01

0 Answers0