Note that there are some explanatory texts on larger screens.

plurals
  1. POinputTextarea inside modalPanel does not update backing bean
    primarykey
    data
    text
    <p>I have this inputTextarea inside a modalPanel, and the only way I got to update the respective value (motivePopupMotive) in the backing bean is by adding an a4j:support in the inputTextarea just to set ajaxSingle=true, like this:</p> <pre><code>&lt;a4j:support event="onchange" ajaxSingle="true"&gt;&lt;/a4j:support&gt; </code></pre> <p>before calling the method save by clicking the button "btnSavePopupMotive". If I don't do this, the value in the backing bean, when I click the "btnSavePopupMotive" button is allways an empty string.</p> <p>But I don't want this solution, because when I call ajax functions I show a "loading" image, and I don't want this image showing up just because the user enter some text in this input. How could I solve this? Here is the code:</p> <pre><code>&lt;div style="position: absolute;"&gt; &lt;a4j:form id="form2"&gt; &lt;r:modalPanel id="panelPopupMotive" resizeable="false" autosized="true" minWidth="300" minHeight="20" &gt; &lt;table width="99%" bgcolor="#FFFFFF" style="border-collapse: collapse; border: 0px solid #000000;"&gt; &lt;tr&gt;&lt;td&gt; &lt;fieldset&gt; &lt;legend class="fmeSmallLegend"&gt;&lt;h:outputText value="Motive" /&gt; &lt;/legend&gt; &lt;table&gt;&lt;tr&gt;&lt;td&gt; &lt;h:inputTextarea id="motivePopupMotive" onkeydown="verifySize(this, 200);" onkeyup="verifySize(this, 200);" onchange="verifySize(this, 200);" value="#{ParameterFaces.motivePopupMotive}" rows="4" style="width: 380px;" onfocus="this.style.background='#FFFED2';" onblur="this.style.background='#F5F5F5';"&gt; &lt;/h:inputTextarea&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;/fieldset&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td align="center"&gt; &lt;a4j:commandButton id="btnSavePopupMotive" value="Save" onclick="saveMotive();" style="width:80px" type="submit" oncomplete="closePopupMotive();" title="Save" reRender="motivePopupMotive,existsErrorMotive"&gt; &lt;/a4j:commandButton&gt; &lt;r:spacer width="5px" /&gt; &lt;a4j:commandButton id="btnCancel" value="Cancel" style="width:80px" oncomplete="Richfaces.hideModalPanel('panelPopupMotive');" title="Cancel"&gt; &lt;/a4j:commandButton&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;script type="text/javascript"&gt; function closePopupMotive(){ if (document.getElementById('form2:motivePopupMotive').value == 'false'){ Richfaces.hideModalPanel('panelPopupMotive'); } } &lt;/script&gt; &lt;a4j:jsFunction name="saveMotive" reRender="motivePopupMotive" oncomplete="saveValidatedMotive();"/&gt; &lt;a4j:jsFunction name="saveValidatedMotive" actionListener="#{ParameterFaces.save}" reRender=""/&gt; &lt;/r:modalPanel&gt; &lt;/a4j:form&gt; &lt;/div&gt; </code></pre> <p>Thanks!!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload