xmcx
xmcx

Reputation: 346

primefaces p:inputSwitch not work in dialog while use update the dialog

I am doing a on-off with p:inputSwitch, it's in a dialog. When an ajax call inside a form happens in combination with an update on the inputSwitch, the inputSwitch behaves strange and always resets its state. Here is a simple reproducible example (without the need of a backing bean):

<h:form id="buttonForm">
    <p:commandButton value="button" update="switch" oncomplete="PF('switchDialog').show();" />
    <p:dialog widgetVar="switchDialog">
        <p:inputSwitch id="switch" />
    </p:dialog>
</h:form>

Interesting observations:

Upvotes: 2

Views: 1383

Answers (1)

C.B.
C.B.

Reputation: 304

Sorry for this zombie post but i've found a solution that can help.

Add in your

<p:dialog widgetVar="switchDialog" dynamic="true">

Regards

Upvotes: 1

Related Questions