0

I followed this excellent example Warn user of unsaved data in JSF

The results are almost perfect.

I get the prompt during submit always. How does this example turn off the message? I thought the $form.submit did that but it doesn't work for me. What did I miss?

My page submits like this:

<h:commandLink value="Save" action="#{report.saveReport}" >
    <f:param name="id" value="#{report.id}"/>
    <f:param name="name" value="#{report.name}"/>
</h:commandLink>
Community
  • 1
  • 1
greenlines
  • 55
  • 1
  • 6

1 Answers1

0

The commandLink is a link, may not perform a "standard" submit. There is probably javascript which generates the submit. This is probably circumventing the logic for the submit code. Bind the form submit event to the onclick for the link, and everything should work fine.

cgp
  • 41,026
  • 12
  • 101
  • 131