Note that there are some explanatory texts on larger screens.

plurals
  1. PORow rendering on extendedDataTable doesnt work
    primarykey
    data
    text
    <p><strong>Question (short version)</strong></p> <p>I have an issue with richfaces(4.3.2-final).<br> I'm trying to rerender a row/cells inside a rich:extendedDataTable. I can't get it to work. The only thing that works is to rerender the whole table. </p> <p>All examples/tutorials i can find are for version 3.3. Those solutions dont work for me.</p> <p>I hope you can help me with a solution or a 4.2+ example/tutorial.</p> <hr> <p><strong>Long version of the question</strong></p> <p><img src="https://i.stack.imgur.com/2mYRT.png" alt="extendedDataTable"> <strong>Not selected row cells:</strong></p> <pre><code>&lt;a4j:outputPanel layout="block" rendered="#{inactive}"&gt; &lt;h:outputText value="#{cc.attrs.rowItem.getValue(cc.attrs.id)}" styleClass="outputField" style="#{cc.attrs.style}"&gt; &lt;/h:outputText&gt; &lt;/a4j:outputPanel&gt; </code></pre> <p><strong>Selected Row cells:</strong></p> <pre><code>&lt;a4j:outputPanel layout="block" rendered="#{active and field.echoed}"&gt; &lt;h:inputText value="#{field.value}" id="#{cc.attrs.id}ID" disabled="#{field.disabled}" readonly="#{field.readonly}" rendered="true" title="#{field.title}"/&gt; .... &lt;/a4j:outputPanel&gt; </code></pre> <p><strong>On selection of other rows:</strong></p> <pre><code>&lt;a4j:ajax event="selectionchange" listener="#{crudBean.actionForm.selectionListener}" render="messages,saveButton,deleteButton,multiOccurenceTable" /&gt; </code></pre> <p><strong>HTML code, not selected row cell:</strong></p> <pre><code>&lt;td class="rf-edt-td-j_idt230"&gt; &lt;div class="rf-edt-c rf-edt-c-j_idt230"&gt; &lt;div class="rf-edt-c-cnt"&gt; &lt;div id="multiOccurenceTable:0:soort:soort"&gt; &lt;div id="multiOccurenceTable:0:soort:j_idt140"&gt; &lt;span class=" outputField" style=""&gt;VO&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/td&gt; </code></pre> <p><strong>Selected row cell HTML:</strong></p> <pre><code>&lt;td class="rf-edt-td-j_idt230"&gt; &lt;div class="rf-edt-c rf-edt-c-j_idt230"&gt; &lt;div class="rf-edt-c-cnt"&gt; &lt;div id="multiOccurenceTable:1:soort:soort"&gt; &lt;div id="multiOccurenceTable:1:soort:j_idt240"&gt; &lt;input id="multiOccurenceTable:1:soort:soortID" name="multiOccurenceTable:1:soort:soortID" value="VO" type="text"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/td&gt; </code></pre> <p><strong>My attempts:</strong> The on selectionchange rerender is now put on the table:"multiOccurenceTable". This works, on every selection change the whole table gets rerendered. </p> <p>For performance i try to update the table on row or cell level. I can't get get this to work. I tried simple and more complex solutions, none worked. What am i doing wrong? (most examples/tutorials are for richfaces 3.3 on the internet which could be a reason)</p> <p>Try 1, manually updating the rows/cells:</p> <p><strong>all 3 rows</strong>: nothing happened when i pressed the 'save' button</p> <pre><code>&lt;a4j:commandLink actionListener="#{crudBean.actionForm.save}" render="multiOccurenceTable:0,multiOccurenceTable:1,multiOccurenceTable:2" reRender="multiOccurenceTable:0,multiOccurenceTable:1,multiOccurenceTable:2"&gt;Save &lt;/a4j:commandLink&gt; </code></pre> <p><strong>One cell</strong>: nothing happened when i pressed the 'save1' button</p> <pre><code>&lt;a4j:commandLink actionListener="#{crudBean.actionForm.save}" render="multiOccurenceTable:@rows(crudBean.actionForm.rowsToUpdate):soort" reRender="multiOccurenceTable:@rows(crudBean.actionForm.rowsToUpdate):soort"&gt;Save1 &lt;/a4j:commandLink&gt; </code></pre> <p>I've also tried with <strong>ajaxKeys</strong> with no succes according to this <a href="https://community.jboss.org/wiki/UsingtheajaxKeysattributeforrichdataList" rel="nofollow noreferrer">tutorial rich 3.x</a> and this <a href="http://java.dzone.com/articles/an-introduction-to-jboss-richf?page=0,5" rel="nofollow noreferrer">example (rich 3.3)</a></p> <p>If you got any possible solutions, please let me know.</p> <hr> <p>My error is fixed. The error was not the rendering. but that the condition for rendering was set outside the component that was rendered. This resulted in rerendering the component with not updated values, which led to no change on the screen.</p> <p>Lessons learned: If you have render conditions make sure the condition values are inside the rerendered component.</p> <hr>
    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.
 

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