Note that there are some explanatory texts on larger screens.

plurals
  1. POunderstanding ajax execute behavior with datatable using jsf 2.0
    primarykey
    data
    text
    <p>i'm trying to use an <strong>search button</strong> which brings back the selected items (can be more than one) and it updates the datatable. Then i have a selectBooleanCheckbox next to each colomn, when user selects "n" items then presses the <strong>Select the checked Items</strong> it insert DB.</p> <p>The code can be seen below:</p> <pre><code>&lt;h:panelGrid columns="5"&gt; &lt;h:form&gt; &lt;h:outputText value="Item Name"/&gt; &lt;p:inputText value="#{StockController.itemName}"/&gt; &lt;h:commandButton value="Search" action="#{StockController.Search}"&gt; &lt;f:ajax execute="@form" render=":results"/&gt; &lt;/h:commandButton&gt; &lt;/h:form&gt; </code></pre> <p>//The code sample below belongs to BalusC see the post <a href="https://stackoverflow.com/questions/7266189/how-to-delete-many-row-in-hdatatable-with-checkbox">here</a></p> <pre><code> &lt;h:panelGroup id="results"&gt; &lt;h:form&gt; &lt;h:dataTable value="#{bean.entities}" var="entity"&gt; &lt;h:column&gt; &lt;h:selectBooleanCheckbox value="#{bean.checked[entity.id]}" /&gt; &lt;/h:column&gt; ... &lt;/h:dataTable&gt; &lt;h:commandButton value="Select the checked Items" action="#{StockController.insertDao}" &gt; &lt;f:ajax execute="@form" render=":results"/&gt; &lt;/h:commandButton&gt; &lt;/h:form&gt; &lt;/h:panelGrid&gt; </code></pre> <p>Now, i have read many blogs and Core javaServer Faces 3, i don't think there is logical error in ajax usage. I tested by removing each ajax then <strong>both works fine</strong> but whenever i try to use <strong>both of cummondButtons</strong> with ajax, the second one "<strong>Select the checked Items</strong>" does not even call the <strong>"StockController.insertDao"</strong> method.</p> <p>Any help is appreciated.</p> <p>Thanks all.</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