0

I want send only some data of my form to the bean. So I have the next code on the view:

<p:commandButton value="Save Group" actionListener="#{configureByTransactionsBean.saveGroup()}"
                        disabled="#{configureByTransactionsBean.causeSelected == null}" update="formulario"
                        process="@(#formulario\\:name)" />

but nothing happens. Nothing arrive to the server and my method saveGroup() is not called. However if I inspect the network with my browser an ajax request has been sent. By the other hand, if I change the attribute procees to @this:

<p:commandButton value="Save Group" actionListener="#{configureByTransactionsBean.saveGroup()}"
                        disabled="#{configureByTransactionsBean.causeSelected == null}" update="formulario"
                        process="@this" />

all works as expected, but obviosly I dont have available the value of my inputtext on server side. So I only want to send to the server the information that is on inputtext with id="name":

<h:form id="formulario">
        <p:panelGrid columns="2">
                <p:outputLabel value="Name" ></p:outputLabel>
                        <p:inputText
                            value="#{configureByTransactionsBean.causeSelected.txtName}"
                            id="name">

                            </p:inputText>
...
...

Can anyone help me?

  • Try `@form:name` in your command button `process` attribute. – Marc Scheib Aug 31 '17 at 15:49
  • @MarcScheib: As far as I know that is an invalid value. It seems you think you have some sort of jquery selector there but it is not. Alberto: make sure you have the right selector. You don't post the commandbutton relation to the form or even more. **Always** create an [mcve], always... And always post version info... – Kukeltje Aug 31 '17 at 20:10
  • Although https://stackoverflow.com/questions/8634156/how-to-find-out-client-id-of-component-for-ajax-update-render-cannot-find-compo is about update/render, the same is true for the process attribute – Kukeltje Aug 31 '17 at 20:11
  • @Kukeltje you are right. `@form` is valid only, however it processes the complete form. `name` without the `@form` is another correct value if the button is within the same form. – Marc Scheib Aug 31 '17 at 20:43
  • The remark about 'name' is not always true. It depends on other naming containers too – Kukeltje Aug 31 '17 at 20:45
  • Thanks for your answers. I have noticed that my jquery selector works because in other component of the page the name is updated properly after click on commandButton. Also the selectors @form:name and :formulario:name works but my method #{configureByTransactionsBean.saveGroup()} is not executed with this three options. When I change it with process="@this" the method is called and it do his job. I dont understand this behavior. Nobody knows the reason of this? – Alberto Fernández Delgado Sep 01 '17 at 08:13

0 Answers0