question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UICommand: reenabled after disableOnAjax when disabled on server side in request

See original GitHub issue

Describe the bug

When a command button action willingly sets the disabled state of the button, the visual state of the button is still enabled. After another page update, this is reflected properly.

Reproducer

Please clone: https://github.com/stolp/primefaces-test/tree/PF-9038

Form:

<h:form id="frmTest">

 <p>It is expected, that the first button disables itself after its action, but it doesn't.</p>
 <p>The second button only refreshes the form to prove that the disabled setting is indeed present.</p>

 <p:commandButton disabled="#{testView.isDisabled()}"
   value="Button Action disables this button" action="#{testView.sleep()}" partialSubmit="true" update="@form" />

 <p:commandButton
   value="Button Action updates the page" action="#{testView.refresh()}" partialSubmit="true" update="@form" />
</h:form>

Expected behavior

The button state should be disabled after the action finishes.

PrimeFaces edition

Community

PrimeFaces version

12.0.0-RC2

Theme

any

JSF implementation

All

JSF version

2.3

Browser(s)

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
stolpcommented, Jul 29, 2022

Thanks for fixing!

0reactions
jepsarcommented, Jul 30, 2022

No, that’s not needed, it is deprecated now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Re enable Ajax after disabling it on client side - Telerik
I'm using a RadGrid within a RajAjaxManager. On a specific LinkButton, I need to export the content of the grid to CSV. So...
Read more >
Re-Enable Submit button after success in AJAX - Stack Overflow
This will re-enable the button $( "#submit" ).prop( "disabled", true ); //disable when ajax call starts jQuery.ajax({ url: ...
Read more >
Unable to disable #mySubmit button - Codecademy
I have most of this exercise figured out except for the step where I need to disable the #mySubmit button before the $.ajax...
Read more >
Re-enabling a disable commandButton does not fire ajax call
I have two command buttons, buttonA and buttonB. buttonA is enable and buttonB is disable (it can enable based on some conditions. it...
Read more >
BootsFaces-OSP/BootsFaces.jsfdsl at master - GitHub
ajax Boolean "Whether the Button submits the form with AJAX." delay "Delays the AJAX request." onclick "The onclick attribute." oncomplete "JavaScript ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found