0

on a form : i have one page include two tab.

Tab rendered some boolean values. e) after first page i have command buton . Yes or no( its reset booelan value)

if ı click yes second page rendered true and page show but all values reset. All data reset ? What is problem ? How can i solve this.

All code is here :http://pastebin.com/Ffi33hdw

Uptade buton line 287 .

    <h:selectOneRadio id="fikirorProje" required="true" value="#{ideaBean.newIdea.fikirProje}"
                                  enabledClass="labelNormalRadio" disabled="#{ideaBean.createdIdea}"
                                  requiredMessage="Bu alan boş bırakılamaz.">
                    <f:selectItem itemValue="#{false}"
                                  itemLabel="Hayır" uptade="butonThree"/>
                    <f:selectItem itemValue="#{true}" itemLabel="Evet"/>
                    <p:ajax event="change" update="addIdeaForm"  />
                    <p:ajaxStatus onstart="PF('status').show()" onsuccess="PF('status').hide()"/>
                </h:selectOneRadio>

thans for answering

Who is are
  • 153
  • 2
  • 3
  • 10
  • 2
    Show a [mcve] here, not in some external link... Nothing in your code shows any reason for the behaviour you experience. And btw, using `prependId="false"` is not recommended! Search stackoverflow on why – Kukeltje Jan 06 '17 at 14:35

1 Answers1

0

Theprocess attribute of p:ajax defaults to @this, so in the change event of your h:selectOneRadio your form is not being fully process which means that the ideaBean's properties will not be updated, (check more info about how update/process work here). Add process="@form" to your ajax event <p:ajax event="change" update="addIdeaForm process="@form" /> and it should work

Community
  • 1
  • 1
David Florez
  • 1,460
  • 2
  • 13
  • 26
  • _"fully process which means that the ideaBean's properties will not be updated"_ Not really, it means that their value (send from client to server) will not be read server side and processed. It does not mean that the component that refers to these fields should lose their value. Most likely it is scope related – Kukeltje Jan 06 '17 at 15:39
  • @Kukeltje as you said "their value (send from client to server) will not be read server side and processed", don´t this means that when he updates the whole form the fields values will be lost? – David Florez Jan 06 '17 at 15:54
  • No, only if the scope is too short (so your answer is not wrong, it is only partly valid in context of the scope that is used). One of the advantages of using ajax (and the `process="@this` default) is that the amount of fields that needs to processed is reduced so with complex forms it takes way less server processing time. But you do need to keep the original values then by using some longer scope. I personally use [`viewAccessScoped` from DeltaSpike](https://deltaspike.apache.org/documentation/jsf.html#@ViewAccessScoped) a lot. Shorter then SessionScoped and longer than requestScoped. – Kukeltje Jan 06 '17 at 16:32