Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A major change from JSF 1.2 to JSF 2 is the introduction of the attributes <code>render</code> and <code>execute</code> replacing <code>rerender</code>. </p> <ul> <li><code>execute</code> partly updates the model of the marked part of the tree</li> <li><code>render</code> renders the marked part of the tree and sends it via AJAX for replacing the original part.</li> </ul> <p>This is handy, when e.g. a Listener updates values also being shown as input-fields on the page.</p> <p><strong>Update:</strong> You are calling <code>addNewRowToAnsChoice</code> on change of <code>answerId</code>, calling the <code>a4j:jsFunction</code> <code>addEmptyAnsChoice</code> later on.</p> <p>There the elements <code>ansChoiceList</code> ,<code>addDiscQuest</code>,<code>applyDiscQuest</code> get rerendered, but nothing is being sent for <code>execute</code>. So the line you entered the <code>answerId</code> in - well - is never updated on server side. </p> <p>In the next step, in the actionListener you remove all empty lines (so also this one, too) and add a fresh line on the bottom.</p> <p>IMO, try skipping the jsFunction call and instead letting the same stuff being executed as a <code>f:ajax</code> or <code>a4j:ajax</code>. The (untested) code might look like following...</p> <pre><code>&lt;h:inputText id="answerID" value="#{dataItem.answerId}" onchange="&lt;yourValidationFunction&gt;"&gt; &lt;a4j:ajax execute="@this" render="ansChoiceList addDiscQuest applyDiscQuest" actionListener="#{DiscQuestMgtController.addEmptyRow}" oncomplete="focusToNewCell('DiscQuestMgtForm',#{fn:length(DiscQuestMgtController.answerChoiceList)});"&gt; &lt;/a4j:ajax&gt; &lt;/h:inputText&gt; </code></pre> <p>This way you keep the ID from the value to be updated on server side. </p> <p>Hope it works and helps...</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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