0

I have a form in which I have multiple text fields, dropdown, checkboxes and so forth. I have a submit button which saves the fields and invokes a confirm dialog after some backend validation.

All the components except for textfields, text area are saved into my bean on click of this button. But if I put an ajax event in the text field, the values are getting saved.

My Command button

<p:commandButton id="submitButton" value="Submit This"
                icon="fa fa-send" action="#{formBean.someAction}"
                partialSubmit="true" process="@this" oncomplete="PF('someDialog').show();" />

Not working text field

<p:inputText id="referenceNumber"
                    value="#{formBean.referenceNumber}"
                    onkeypress="return event.keyCode != 13;">

                </p:inputText>

working text field

<p:inputText id="pmrReferenceNumber"
                    value="#{formBean.pmr.pmrReferenceNumber}"
                    disabled="#{formBean.isDisabled('pmrReferenceNumber')}"
                    onkeypress="return event.keyCode != 13;">
                    <p:ajax process="@this" partialSubmit="true" />
                </p:inputText>

Ideally the button should save the text fields but they are not doing it. And I have configured primefaces.SUBMIT as partial in my web.xml.

user1734698
  • 157
  • 2
  • 2
  • 17
  • 1
    Possible duplicate of [commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated](https://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value) – Selaron Apr 24 '19 at 12:10
  • Does it work using h:inputText? – Selaron Apr 24 '19 at 14:29
  • #9 in the duplicate – Kukeltje Apr 24 '19 at 14:37

0 Answers0