0

In relation with my original question I still have the following issue: process a selectOneRadio value in one column of a table to update a value in another column of the same table.

In my original question where I tried it with a datatable and a subtable, after lametaweb's suggestion and as this question did not give successful result because of the following behaviour: "tabView1:1:form1:mainTable:0:subTable1:0:panel" (without correct cliendId) seen in the HTML, I manually built the table with nested <c:forEach> to reconstruct the same.

But neither nor are updating the value in the table. And Here is an example of the actual clientId in the HTML: form0:j_idt71:0.

<h:form id="form0">

<table id="table0">

        <c:forEach var="head" items="#{subTableView.getAllHeaders('tabName')}">

                <tr>
                    <td>
                        <h:outputLabel style="bold" value="#{head.name}" />
                    </td>
                </tr>

            <c:forEach var="row" items="#{head.questions}">

                <tr>
                    <td width="300" height="33">
                        <h:outputLabel value="#{row.question}" />
                    </td>

                    <td width="500">

                        <p:selectOneRadio id="mainSelect" value="#{row.select1}" >

                            <f:selectItem itemLabel="Yes" itemValue="#{row.responseOfYes}" />
                            <f:selectItem itemLabel="No" itemValue="#{row.responseOfNo}" />/>

                        <p:ajax update="display"                                                                                        listener="#{subTableView.updateSecond(row.select1)}"/>

                        </p:selectOneRadio>

                    </td>

                    <td width="600">

                            <h:outputLabel id="display" value="#{row.select1}" />

                    </td>
                </tr>
            </c:forEach>

        </c:forEach>

</table>
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
LEK
  • 83
  • 2
  • 11
  • `` `. (You are unnecessarily using `` for displaying text. Its sole purpose is different. Use `` instead). Additionally, insist upon using `

    `.

    – Tiny Nov 17 '15 at 17:40
  • @Tiny: Thanks, not working neither with binding nor with ``. Is the `clientId` inside `` to be used as-is? or shall I refer it to a tag? – LEK Nov 18 '15 at 18:26
  • Try displaying the outcome of `#{display.clientId}` somewhere and compare **the generated** `id` of `` (or `` whatever you are using). They should be the same. If the problem still persists then, it should persist somewhere else - it should be caused by something else. – Tiny Nov 18 '15 at 18:34
  • @Tiny how would you display the Id of ``? – LEK Nov 18 '15 at 19:42
  • Just do `#{display.clientId}` inside the table (the inner most ``) somewhere just for the purpose of testing (and then remove it once done). – Tiny Nov 18 '15 at 19:50
  • @Tiny: I did I have something like form0:j_idt188. But what should I compare this with? – LEK Nov 18 '15 at 19:53
  • The generated `id` of `` or `` whatever you are using. Do "View page source" on the target browser but I doubt the problem should persist somewhere else. Check also for any possible JavaScript error on the browser console (press F12 (Google Chrome)). – Tiny Nov 18 '15 at 19:59
  • @Tiny: You know what's interesting: there is nothing! I have the column ` ` empty. I opened the developer tools: I don't see anything wrong. – LEK Nov 18 '15 at 20:20
  • Awkward. What JSF/PrimeFaces version do you use? An empty `` with no corresponding ` – Tiny Nov 18 '15 at 20:42
  • @Tiny: Yes sure Iam doing the same way by putting it inside a tag. Yes no label is displayed except for the last row: with the binding I lost the row.select1 data. Iam using JSF 2.2, with Wildfly 9.0.1 and PF 5.3. I have the following lines: `` – LEK Nov 19 '15 at 10:29

0 Answers0