0

I have a problem in jsf. My code:

<h:commandLink immediate="true" action="#{connectionController.removeConnect(con.id)}"></h:commandLink>

It works ok, but when I reload page action still remove 1 record. How to fix this problem?

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • 1
    How does the method `removeConnect()` look like along with the managed bean itself? This problem cannot be reproduced, if someone attempts to do the same on a blank project having a single XHTML file. Therefore, you should be explicit stating and isolating the problem. Currently, no symptoms match what you stated, "*When I reload page action still remove 1 record*". – Tiny Mar 07 '15 at 06:27
  • When i reload page == I click delete one record in database @@ – Zon Joker Mar 07 '15 at 07:02
  • As said earlier, you may have a scenario where you may happen to accidentally invoke the action method `removeConnect()` on page load somehow from somewhere which is supposed to invoke only when the given `` is clicked. You had better isolate the problem domain to reflect this or something else which might be the culprit or at least you might think of something which is likely to be a culprit but before that I hope, you yourself will have finished solving the problem itself while isolating the problem domain :) – Tiny Mar 07 '15 at 07:19
  • My problem not duplicate...When 1 refresh : delete 1 record. When 2 refresh : delete 1 record ..... – Zon Joker Mar 08 '15 at 12:32
  • I misinterpreted the question in the beginning. It is just that you need to prevent duplicate form submits somehow which the duplicate question link will precisely assist for. – Tiny Mar 08 '15 at 16:08

0 Answers0