0

Hello folks, for what i've been reading here its a common problem to JSF Programmers, have tried many of the answers to previous topics but i can resolve my issue. Thats why im opening this topic

Topics ive read :

1- Primefaces dialog + commandButton

2- Input given in JSF page does not set that value to manged bean variable

3-Setting Managed Bean attribute's value from JSF page and using it in bean's methods

4- PrimeFaces nested form inside p:dialog with appendTo="@(body)

I've having this trouble for over a week now , im using -->

Primefaces 5.3

Apache Tomcat 7

Eclipse Kepler as IDE

So... what is happening is, i have two commandButton inside a dialog, one its related to Save (Submit) data to the server, and the other is to cancel the process. Right now when i click on the save button it calls the bean method, but the data that supposes to get to this method its comes empty or null ... i dont know why this is happening

I've tried so far:

1 - Changing from action to actionListener

2 - Removing/adding the "type" atribute

3 - Changing oncomplete for onclick

and many more that i not even remember ...

Ill post below part of the code of the XHTML

Any replies will be appreciated :)

Thanky you all,

Cheers!


            <p class="text-right">
                    <p:commandButton value="#{msgs.button_accept}" id="addNewInvGroupCButton" 
                    action="#{candidateBean.addInvGroup}" icon="fa fa-check" process="@this" 
                    update=":mainForm:somInvestigationGroupBox,dialogInvestigationGroup"
                    oncomplete="PF('dialogInvestigationGroup').close()"/>
                    <p:commandButton value="#{msgs.button_close}"  id="discardNewInvGroupCButton" 
                    actionListener="#{candidateBean.resetInvGroupData}" oncomplete="PF('dialogInvestigationGroup').close();" process="@this"
                    ></p:commandButton>
            </p>
Community
  • 1
  • 1
AvB
  • 1
  • 2
  • Hi, Welcome to SO. What topics did you read and why did they not help (see also [ask]). What can you remove in this question and have it still demonstrate the problem? Can the `icon` attributes be removed? The outputLabels? The outputText? The divs with the col classes? Is the dialog relevant? The show and hide things? Remove EL and use fixed strings. Please remove all that is not needed. What is the version info of things? Is it PrimeFaces related or not (does it have the same problem with plain jsf buttons with ajax in it? See also http://www.stackoverflow.com/tags/jsf/info and [mcve] – Kukeltje Jun 16 '16 at 18:36
  • ok ok thanks, i just updated the topic, cheers. – AvB Jun 17 '16 at 19:29
  • Now there is no input anymore, so nothing to submit. Add one input and try removing other stuff... The cancel button (close?) does what you expect, the save button (accept?) does not... Compare them. Are they more or less the same? What do all the attributes on the commandButton do... Why e.g. the process attribute there, know what it does? Sorry I don't give you the direct answer (it is a duplicate of other questions, but this helps you getting to the cause of 'problems' quicker next time and maybe just find things yourself or post more direct/better questions directly. – Kukeltje Jun 18 '16 at 18:15
  • And on the right ('related' block) there are topics that are related. You can find info there to do debugging. And see http://stackoverflow.com/questions/15924805/backing-bean-method-is-getting-null-from-inputs and http://stackoverflow.com/questions/16202671/primefaces-with-managedbeans-always-return-null and the best: http://stackoverflow.com/questions/25339056/understanding-process-and-update-attributes-of-primefaces – Kukeltje Jun 18 '16 at 18:26
  • 1
    Better yet, read and remember the top 20 topics of [jsf](https://stackoverflow.com/questions/tagged/jsf?sort=votes) and [PrimeFaces](https://stackoverflow.com/questions/tagged/primefaces?sort=votes) and keep a look at http://jsf.zeef.com – Kukeltje Jun 18 '16 at 18:30
  • fixed the problem , added and its works ok, thanks for replying – AvB Jun 22 '16 at 19:09

0 Answers0