0

I have a JSF page. The framework is PrimeFaces. The layers build up like topbar, sidebar, main-layout. The sidebar and top bar contain a menu. Both menus are in a <form>:

<p:commandLink action="#{bean.modify}" ajax="false">
    <span>Modify</span>
</p:commandLink>

The main layout also contains buttons form in another form tThe button contains a confirmDialog):

<p:commandLink id="close" action="#{bean.close}" ajax="false" update="form">
    <span>Close</span>
    <p:confirm header="Lezárás" message="Are you sure close it?" icon="ui-icon-alert"/>
</p:commandLink>

If I use ajax=true, just by clicking on the button in the main layout, confirmDialog does not appear. If I use ajax = false, confirmationDialog will appear, but the page will break down for a short time. First, the page will be displayed without css formatting, and later the css will be validated.

Why can this be? What's the difference between the seven calls? In one case, why does this render the rendering in the other case why the confirmDialogs do not come up?

Update:

I've read the link, but I still do not understand why it works. I may have written the problem incorrectly.

There is a JSF page: list.xhtml. It is a commandLink

<p:commandLink action="#{bean.modify}" ajax="false">
        <span>Modify</span>
</p:commandLink>

The backing bean:

public String modify(){
   return "edit.xhtml";
}

The edit.xhtml has the button with confirmDialog:

<p:commandLink id="close" action="#{bean.close}" ajax="false" update="form">
    <span>Close</span>
    <p:confirm header="Lezárás" message="Are you sure close it?" icon="ui-icon-alert"/>
</p:commandLink>

If I call edit.html with list.xhtm with ajax = true then confirmDialog works but the page is rendering slowly.

If I call ajax = false then rendering is fast but confirmationDialog does not work.

I do not understand because it is another page, so not just part of it is updated but the entire page

B. J.
  • 89
  • 1
  • 6
  • English please! – Kukeltje Nov 09 '18 at 12:00
  • Sorry. I was translate it. – B. J. Nov 09 '18 at 12:29
  • You know the main difference between ajax and non-ajax do you? With ajax you explicitly need to tell what to update/render... If you omit that, nothing will be updated https://stackoverflow.com/questions/25339056/understanding-primefaces-process-update-and-jsf-fajax-execute-render-attributes – Kukeltje Nov 09 '18 at 12:31
  • It still does not work and I still do not understand why. I've updated the post. – B. J. Nov 12 '18 at 12:06

1 Answers1

1

Solved

There was a bug in PrimeFaces.

https://github.com/primefaces/primefaces/commit/9f86efba16ead70f9db1194744d291a7f64acefb

I've corrected the bug in source code version 6.2 and has been working well since then.

B. J.
  • 89
  • 1
  • 6
  • Good catch, I would not have thought something like this would be the cause. I was seriously thinking more in the ajax update, especially since you title was sooo generic (care to improve it)? – Kukeltje Nov 14 '18 at 09:36