Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding Primefaces components dynamically
    primarykey
    data
    text
    <p>I want to add Primefaces components dynamically. I'm using solution similar to <a href="https://stackoverflow.com/questions/8046116/can-i-add-remove-primefaces-components-dynamically">this one</a>, which was discussed there earlier:</p> <pre class="lang-xml prettyprint-override"><code>&lt;h:form&gt; &lt;h:panelGrid columns="2"&gt; &lt;p:dataGrid id="categoriesGrid" value="#{bean.categories}" var="categoryBean" rowIndexVar="rowIndex"&gt; &lt;p:column&gt; &lt;p:selectOneMenu id="categorySelect" effect="drop" value="#{categoryBean.selectedCategory}" &gt; &lt;f:selectItems value="#{categoryBean.availableCategories}" var="category" itemLabel="#{category.name}" itemValue="#{category}" /&gt; &lt;/p:selectOneMenu&gt; &lt;/p:column&gt; &lt;/p:dataGrid&gt; &lt;p:commandButton actionListener="#{bean.addNewCategory}" value="Add category" update="categoriesGrid"/&gt; &lt;/h:panelGrid&gt; &lt;/h:form&gt; </code></pre> <p>But there is problem with it. There is example of respond I get after "Add category" button was clicked:</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt; &lt;partial-response&gt; &lt;error&gt; &lt;error-name&gt; class javax.faces.component.UpdateModelException &lt;/error-name&gt; &lt;error-message&gt; &lt;![CDATA[/createTutorial.xhtml @85,65 value= "#{categoryBean.selectedCategory}":java.util.NoSuchElementException]]&gt; &lt;/error-message&gt; &lt;/error&gt; &lt;/partial-response&gt; </code></pre> <p>Thanks in advance</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.
 

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